Add os.Unsetenv to NoErrorCheck whitelist (#702)

it always return nil err
This commit is contained in:
Yuval Kashtan 2021-10-05 20:30:34 +03:00 committed by GitHub
parent e73248cc12
commit 1933cba5b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {