Used defer to close the attributes file

This commit is contained in:
Michael Käufl 2015-06-16 15:57:49 +02:00
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() {