mirror of
https://github.com/securego/gosec.git
synced 2025-03-17 20:57:54 +02:00
prefix patterns with **/ to match subdirectories
This commit is contained in:
parent
37205e9afa
commit
365ae31b3a
@ -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