mirror of
https://github.com/securego/gosec.git
synced 2025-11-25 22:22:17 +02:00
Refactor path matching logic
Effectively using filepath.Glob to build a set of files and directories to exclude from the scan. (ref: https://golang.org/pkg/path/filepath/#Glob)
This commit is contained in:
4
main.go
4
main.go
@@ -139,8 +139,8 @@ func main() {
|
||||
flag.Usage = usage
|
||||
|
||||
// Exclude files
|
||||
var excluded filelist = []string{"*_test.go"}
|
||||
flag.Var(&excluded, "skip", "File pattern to exclude from scan")
|
||||
excluded := newFileList("**/*_test.go")
|
||||
flag.Var(excluded, "skip", "File pattern to exclude from scan")
|
||||
|
||||
incRules := ""
|
||||
flag.StringVar(&incRules, "include", "", "Comma separated list of rules IDs to include. (see rule list)")
|
||||
|
||||
Reference in New Issue
Block a user