Skip to content

Commit 2d56e8e

Browse files
committed
Fix file path regex on Windows
1 parent f374144 commit 2d56e8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/pkg/otel/manager/diagnostics.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ func getRegexpsForRegistryFiles() []*regexp.Regexp {
215215
}
216216

217217
for _, lst := range preFilesList {
218-
pathRe := filepath.Join(lst...)
218+
// On windows, we need to ensure we escape the path separator, because backslash has a special meaning
219+
separator := regexp.QuoteMeta(string(filepath.Separator))
220+
pathRe := strings.Join(lst, separator)
219221
re := regexp.MustCompile(pathRe)
220222
registryFileRegExps = append(registryFileRegExps, re)
221223
}

0 commit comments

Comments
 (0)