From 1933cba5b544e130400cc9f348100400f071368c Mon Sep 17 00:00:00 2001 From: Yuval Kashtan Date: Tue, 5 Oct 2021 20:30:34 +0300 Subject: [PATCH] Add os.Unsetenv to NoErrorCheck whitelist (#702) it always return nil err --- rules/errors.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/errors.go b/rules/errors.go index 7a34bc6340..f3360ec69a 100644 --- a/rules/errors.go +++ b/rules/errors.go @@ -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 {