Merge pull request #166 from cosmincojocar/fprint_whitelist

Add Fprint, Fprintf, Fprintln to NoErrorCheck whitelist
This commit is contained in:
Grant Murphy 2018-02-08 11:54:44 +10:00 committed by GitHub
commit 6b28d5c0e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ func NewNoErrorCheck(conf gas.Config) (gas.Rule, []ast.Node) {
// black list instead. // black list instead.
whitelist := gas.NewCallList() whitelist := gas.NewCallList()
whitelist.AddAll("bytes.Buffer", "Write", "WriteByte", "WriteRune", "WriteString") 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") whitelist.Add("io.PipeWriter", "CloseWithError")
if configured, ok := conf["G104"]; ok { if configured, ok := conf["G104"]; ok {