MCPcopy Create free account
hub / github.com/bracesdev/errtrace / packageSelectorMatch

Function packageSelectorMatch

cmd/errtrace/toolexec.go:315–326  ·  view source on GitHub ↗
(selector, importPath string)

Source from the content-addressed store, hash-verified

313}
314
315func 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}

Callers 1

requiredPackageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected