Skip to content

Commit

Permalink
Ignore false-positive gosec G307 linting errors
Browse files Browse the repository at this point in the history
Issues reported after upgrading golangci-lint to v1.43.0.
gosec was updated in that version from v2.8.1 to v2.9.1.

refs #61
refs golangci/golangci-lint#2299
  • Loading branch information
atc0005 committed Nov 9, 2021
1 parent c676309 commit f3ec10e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func (c *Config) loadConfigFile(configFile string) error {
return err
}

// #nosec G307
// Believed to be a false-positive from recent gosec release
// https://github.com/securego/gosec/issues/714
defer func() {
if err := fh.Close(); err != nil {
// Ignore "file already closed" errors
Expand Down

0 comments on commit f3ec10e

Please sign in to comment.