close file using existing style

main
Dan Bent 5 years ago
parent 80fdcd65de
commit 310284f8d7

@ -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

Loading…
Cancel
Save