From c4fb8cf7c2877482f59586afb5250d864148814f Mon Sep 17 00:00:00 2001 From: Nuruddin Ashr Date: Sun, 17 Dec 2017 21:54:54 +0700 Subject: [PATCH] Add Fprint, Fprintf, Fprintln to NoErrorCheck whitelist --- rules/errors.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rules/errors.go b/rules/errors.go index 2bf61c9..88fad63 100644 --- a/rules/errors.go +++ b/rules/errors.go @@ -15,9 +15,10 @@ package rules import ( - gas "github.com/GoASTScanner/gas/core" "go/ast" "go/types" + + gas "github.com/GoASTScanner/gas/core" ) type NoErrorCheck struct { @@ -75,7 +76,7 @@ func NewNoErrorCheck(conf map[string]interface{}) (gas.Rule, []ast.Node) { // black list instead. whitelist := gas.NewCallList() whitelist.AddAll("bytes.Buffer", "Write", "WriteByte", "WriteRune", "WriteString") - whitelist.AddAll("fmt", "Print", "Printf", "Println") + whitelist.AddAll("fmt", "Print", "Printf", "Println", "Fprint", "Fprintf", "Fprintln") whitelist.Add("io.PipeWriter", "CloseWithError") if configured, ok := conf["G104"]; ok {