Skip to content

Commit

Permalink
Add os.Unsetenv to NoErrorCheck whitelist (#702)
Browse files Browse the repository at this point in the history
it always return nil err
  • Loading branch information
yuvalk authored Oct 5, 2021
1 parent e73248c commit 1933cba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func NewNoErrorCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
whitelist.AddAll("strings.Builder", "Write", "WriteByte", "WriteRune", "WriteString")
whitelist.Add("io.PipeWriter", "CloseWithError")
whitelist.Add("hash.Hash", "Write")
whitelist.Add("os", "Unsetenv")

if configured, ok := conf["G104"]; ok {
if whitelisted, ok := configured.(map[string]interface{}); ok {
Expand Down

0 comments on commit 1933cba

Please sign in to comment.