From 3c230ac0f7311fe9065cea72527d69e1a66c24d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=82=AC=E3=82=AA=E3=83=8E=E3=82=AD=E3=83=9F?= =?UTF-8?q?=E3=83=98?= <38399410+For-ACGN@users.noreply.github.com> Date: Sun, 13 Jun 2021 19:30:49 +0800 Subject: [PATCH] errors.go: add Hash.Write() to the white list. (#648) --- rules/errors.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/errors.go b/rules/errors.go index f16f91d..7a34bc6 100644 --- a/rules/errors.go +++ b/rules/errors.go @@ -86,6 +86,7 @@ func NewNoErrorCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { whitelist.AddAll("fmt", "Print", "Printf", "Println", "Fprint", "Fprintf", "Fprintln") whitelist.AddAll("strings.Builder", "Write", "WriteByte", "WriteRune", "WriteString") whitelist.Add("io.PipeWriter", "CloseWithError") + whitelist.Add("hash.Hash", "Write") if configured, ok := conf["G104"]; ok { if whitelisted, ok := configured.(map[string]interface{}); ok {