Skip to content

Commit adb4222

Browse files
endoramaCosmin Cojocar
authored andcommitted
whitelist strings.Builder method in rule G104
1 parent 9b966a4 commit adb4222

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rules/errors.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func NewNoErrorCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
8181
whitelist := gosec.NewCallList()
8282
whitelist.AddAll("bytes.Buffer", "Write", "WriteByte", "WriteRune", "WriteString")
8383
whitelist.AddAll("fmt", "Print", "Printf", "Println", "Fprint", "Fprintf", "Fprintln")
84+
whitelist.AddAll("strings.Builder", "Write", "WriteByte", "WriteRune", "WriteString")
8485
whitelist.Add("io.PipeWriter", "CloseWithError")
8586

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

0 commit comments

Comments
 (0)