matchPath does a simple glob-like match: supports * and ** patterns, and falls back to substring matching.
(pattern, path string)
| 223 | // matchPath does a simple glob-like match: supports * and ** patterns, |
| 224 | // and falls back to substring matching. |
| 225 | func matchPath(pattern, path string) bool { |
| 226 | // Simple substring match for non-glob patterns |
| 227 | if !strings.ContainsAny(pattern, "*?") { |
| 228 | return strings.Contains(path, pattern) |
| 229 | } |
| 230 | // Use filepath.Match for simple globs |
| 231 | matched, _ := filepath.Match(pattern, path) |
| 232 | if matched { |
| 233 | return true |
| 234 | } |
| 235 | // Also try matching against just the filename |
| 236 | matched, _ = filepath.Match(pattern, filepath.Base(path)) |
| 237 | return matched |
| 238 | } |
no outgoing calls