close file using existing style
@@ -137,7 +137,6 @@ func GfmrunActionFunc(c *cli.Context) error {
if err != nil {
return err
}
- defer file.Close()
var counter int
scanner := bufio.NewScanner(file)
@@ -147,6 +146,11 @@ func GfmrunActionFunc(c *cli.Context) error {
}
}
+ err = file.Close()
+ if err != nil {
+ return err
+ }
+
err = scanner.Err()
if err != nil {
return err
