mirror of
https://github.com/golang/go
synced 2024-11-22 03:54:39 -07:00
x/mod/module: accept trailing slash in MatchPrefixPattern
Trailing slash of glob is not accepted in MatchPrefixPattern. close #48513
This commit is contained in:
parent
7d67f8d435
commit
9c4d9fa40c
4
src/cmd/vendor/golang.org/x/mod/module/module.go
generated
vendored
4
src/cmd/vendor/golang.org/x/mod/module/module.go
generated
vendored
@ -811,6 +811,10 @@ func MatchPrefixPatterns(globs, target string) bool {
|
||||
continue
|
||||
}
|
||||
|
||||
// Remove the trailing slash in glob
|
||||
if glob[len(glob)-1] == '/' {
|
||||
glob = glob[:len(glob)-1]
|
||||
}
|
||||
// A glob with N+1 path elements (N slashes) needs to be matched
|
||||
// against the first N+1 path elements of target,
|
||||
// which end just before the N+1'th slash.
|
||||
|
Loading…
Reference in New Issue
Block a user