mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 20:15:54 +00:00
Add Fprint, Fprintf, Fprintln to NoErrorCheck whitelist
This commit is contained in:
parent
6de76c9261
commit
c4fb8cf7c2
1 changed files with 3 additions and 2 deletions
|
@ -15,9 +15,10 @@
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
gas "github.com/GoASTScanner/gas/core"
|
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/types"
|
"go/types"
|
||||||
|
|
||||||
|
gas "github.com/GoASTScanner/gas/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NoErrorCheck struct {
|
type NoErrorCheck struct {
|
||||||
|
@ -75,7 +76,7 @@ func NewNoErrorCheck(conf map[string]interface{}) (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 {
|
||||||
|
|
Loading…
Reference in a new issue