close file using existing style
This commit is contained in:
6
build.go
6
build.go
@@ -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
|
||||
|
Reference in New Issue
Block a user