Skip to content

Commit

Permalink
Merge pull request github#586 from SchumacherFM/fClose-Fix
Browse files Browse the repository at this point in the history
go/base: Do not ignore f.Close error
  • Loading branch information
Shlomi Noach authored May 9, 2018
2 parents 4b1b70d + ef28068 commit ffc9583
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go/base/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ func FileExists(fileName string) bool {
func TouchFile(fileName string) error {
f, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE, 0755)
if err != nil {
return (err)
return err
}
defer f.Close()
return nil
return f.Close()
}

// StringContainsAll returns true if `s` contains all non empty given `substrings`
Expand Down

0 comments on commit ffc9583

Please sign in to comment.