1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-27 22:28:20 +02:00

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

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 {