Used defer to close the attributes file
This commit is contained in:
parent
7f9275d971
commit
b83fe22e57
@ -49,6 +49,7 @@ func untrackCommand(cmd *cobra.Command, args []string) {
|
||||
Print("Error opening .gitattributes for writing")
|
||||
return
|
||||
}
|
||||
defer attributesFile.Close()
|
||||
|
||||
scanner := bufio.NewScanner(attributes)
|
||||
|
||||
@ -75,8 +76,6 @@ func untrackCommand(cmd *cobra.Command, args []string) {
|
||||
Print("Untracking %s", fields[0])
|
||||
}
|
||||
}
|
||||
|
||||
attributesFile.Close()
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
Loading…
Reference in New Issue
Block a user