From 55ab5bba17a5221a51df244c8a3aeb1898cbdf1a Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 9 Jan 2026 11:01:00 -0500 Subject: [PATCH] path/filepath: Match: improve doc comment Change-Id: Ic7a6e11ddeb79af67ece345405cdca6cf5199173 Reviewed-on: https://go-review.googlesource.com/c/go/+/735180 Reviewed-by: Damien Neil Auto-Submit: Alan Donovan LUCI-TryBot-Result: Go LUCI --- src/path/filepath/match.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/path/filepath/match.go b/src/path/filepath/match.go index 7ccf71ee0c..3c1c22bb8a 100644 --- a/src/path/filepath/match.go +++ b/src/path/filepath/match.go @@ -28,13 +28,15 @@ var ErrBadPattern = errors.New("syntax error in pattern") // '[' [ '^' ] { character-range } ']' // character class (must be non-empty) // c matches character c (c != '*', '?', '\\', '[') -// '\\' c matches character c +// '\\' c matches character c (except on Windows) // // character-range: // c matches character c (c != '\\', '-', ']') -// '\\' c matches character c +// '\\' c matches character c (except on Windows) // lo '-' hi matches character c for lo <= c <= hi // +// Path segments in the pattern must be separated by [Separator]. +// // Match requires pattern to match all of name, not just a substring. // The only possible returned error is [ErrBadPattern], when pattern // is malformed.