diff --git a/changelog/unreleased/issue-364.toml b/changelog/unreleased/issue-364.toml new file mode 100644 index 00000000..221f667f --- /dev/null +++ b/changelog/unreleased/issue-364.toml @@ -0,0 +1,6 @@ +type = "fixed" +message = "Match collector_binaries_accesslist case insensitive on Windows and MacOS." + +issues = ["364"] +pulls = ["467"] + diff --git a/dist/go.mod b/dist/go.mod deleted file mode 100644 index ff0d3da7..00000000 --- a/dist/go.mod +++ /dev/null @@ -1 +0,0 @@ -// Ignore sub-tree diff --git a/helpers/helper.go b/helpers/helper.go index 4c09b591..52edc6db 100644 --- a/helpers/helper.go +++ b/helpers/helper.go @@ -212,7 +212,14 @@ func PathMatch(path string, patternList []string) (PathMatchResult, error) { } for _, pattern := range patternList { - match, err := filepath.Match(pattern, result.Path) + var match bool + var err error + if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { + // ignore case on windows and MacOS. Both have usually case-insensitive filesystems. + match, err = filepath.Match(strings.ToLower(pattern), strings.ToLower(result.Path)) + } else { + match, err = filepath.Match(pattern, result.Path) + } if err != nil { result.Match = false return result, err