Skip to content

Commit

Permalink
whitelist strings.Builder method in rule G104
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama authored and Cosmin Cojocar committed Nov 11, 2018
1 parent 9b966a4 commit adb4222
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func NewNoErrorCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
whitelist := gosec.NewCallList()
whitelist.AddAll("bytes.Buffer", "Write", "WriteByte", "WriteRune", "WriteString")
whitelist.AddAll("fmt", "Print", "Printf", "Println", "Fprint", "Fprintf", "Fprintln")
whitelist.AddAll("strings.Builder", "Write", "WriteByte", "WriteRune", "WriteString")
whitelist.Add("io.PipeWriter", "CloseWithError")

if configured, ok := conf["G104"]; ok {
Expand Down

0 comments on commit adb4222

Please sign in to comment.