mirror of
https://github.com/securego/gosec.git
synced 2025-01-22 03:09:59 +02:00
Merge pull request #46 from drewwells/feature/exclusions
prefix patterns with **/ to match subdirectories
This commit is contained in:
commit
e4b1e28f53
@ -57,6 +57,11 @@ func (f *filelist) Contains(pathname string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// match file suffixes ie. *_test.go
|
||||
if matched, _ := filepath.Match(filepath.Join("**", pattern), pathname); matched {
|
||||
return true
|
||||
}
|
||||
|
||||
// Finally try absolute path
|
||||
st, e := os.Stat(rel)
|
||||
if os.IsExist(e) && st.IsDir() && strings.HasPrefix(abs, rel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user