path/filepath: Match does not use Glob patterns #41394
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Based on docuemntation and the Go playground, yes. https://play.golang.org/p/WHq5MYYn_yf
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I passed the pattern
"ga*[!k]"
tofilepath.Match
expecting it to not match the string"gazonk"
(as it clearly states it must match the entire pattern, and the glob-like syntax for a negated character class is[!...]
). It turns out that filepath.Match actually uses regexp-like syntx for character classes.https://play.golang.org/p/WHq5MYYn_yf
What did you expect to see?
I expected a function that says "shell file name pattern" to understand glob patterns. Especially since filepath.Glob says "uses the same pattern as Match".
What did you see instead?
I saw a function that partially uses glob patterns and partially (well, specifically for character classes) uses regexp patterns.
The text was updated successfully, but these errors were encountered: