(selector, importPath string)
| 313 | } |
| 314 | |
| 315 | func packageSelectorMatch(selector, importPath string) bool { |
| 316 | if pkgPrefix, ok := strings.CutSuffix(selector, "..."); ok { |
| 317 | // foo/... should match foo, but not foobar so we want |
| 318 | // the pkgPrefix to contain the /. |
| 319 | if strings.TrimSuffix(pkgPrefix, "/") == importPath { |
| 320 | return true |
| 321 | } |
| 322 | return strings.HasPrefix(importPath, pkgPrefix) |
| 323 | } |
| 324 | |
| 325 | return selector == importPath |
| 326 | } |