mirror of
https://github.com/securego/gosec.git
synced 2025-03-01 04:33:29 +00:00
prefix patterns with **/ to match subdirectories
This commit is contained in:
parent
37205e9afa
commit
365ae31b3a
1 changed files with 5 additions and 0 deletions
|
@ -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…
Reference in a new issue