1
0
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:
Grant Murphy
2016-09-10 14:55:12 -07:00
parent b5a98c12a8
commit 59fbf7446d
2 changed files with 46 additions and 48 deletions

View File

@@ -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)")