prefix patterns with **/ to match subdirectories

This commit is contained in:
Drew Wells 2016-08-24 12:26:18 -05:00
parent 37205e9afa
commit 365ae31b3a

View file

@ -57,6 +57,11 @@ func (f *filelist) Contains(pathname string) bool {
return true return true
} }
// match file suffixes ie. *_test.go
if matched, _ := filepath.Match(filepath.Join("**", pattern), pathname); matched {
return true
}
// Finally try absolute path // Finally try absolute path
st, e := os.Stat(rel) st, e := os.Stat(rel)
if os.IsExist(e) && st.IsDir() && strings.HasPrefix(abs, rel) { if os.IsExist(e) && st.IsDir() && strings.HasPrefix(abs, rel) {