From 821b04dafbc5e94223766b15622d9b7b38b2f576 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Tue, 16 Jan 2018 16:55:06 +0000 Subject: [PATCH] path: remove filename mentions from pattern godocs path.Match works purely with strings, not file paths. That's what sets it apart from filepath.Match. For example, only filepath.Match will change its behavior towards backslashes on Windows, to accomodate for the file path separator on that system. As such, path.Match should make no mention of file names. Nor should path.ErrBadPattern mention globbing at all - the package has no notion of globbing, and the error concerns only patterns. For a similar reason, remove the mention of globbing from filepath.ErrBadPattern. The error isn't reserved to just globbing, as it can be returned from filepath.Match. And, as before, it only concerns the patterns themselves. Change-Id: I58a83ffa3e2549625d8e546ef916652525504bd1 Reviewed-on: https://go-review.googlesource.com/87857 Reviewed-by: Rob Pike --- src/path/filepath/match.go | 2 +- src/path/match.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/path/filepath/match.go b/src/path/filepath/match.go index 5168e037b5..057f7f3677 100644 --- a/src/path/filepath/match.go +++ b/src/path/filepath/match.go @@ -13,7 +13,7 @@ import ( "unicode/utf8" ) -// ErrBadPattern indicates a globbing pattern was malformed. +// ErrBadPattern indicates a pattern was malformed. var ErrBadPattern = errors.New("syntax error in pattern") // Match reports whether name matches the shell file name pattern. diff --git a/src/path/match.go b/src/path/match.go index 8d9aa513b1..d39d24450a 100644 --- a/src/path/match.go +++ b/src/path/match.go @@ -10,10 +10,10 @@ import ( "unicode/utf8" ) -// ErrBadPattern indicates a globbing pattern was malformed. +// ErrBadPattern indicates a pattern was malformed. var ErrBadPattern = errors.New("syntax error in pattern") -// Match reports whether name matches the shell file name pattern. +// Match reports whether name matches the shell pattern. // The pattern syntax is: // // pattern: -- 2.50.0