close file using existing style
This commit is contained in:
parent
80fdcd65de
commit
310284f8d7
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
|
||||
|
Loading…
Reference in New Issue
Block a user