MCPcopy Create free account
hub / github.com/maruel/panicparse / hasPrefix

Function hasPrefix

stack/context.go:913–921  ·  view source on GitHub ↗

hasPrefix returns true if any of s is the prefix of p.

(p string, s map[string]string)

Source from the content-addressed store, hash-verified

911
912// hasPrefix returns true if any of s is the prefix of p.
913func hasPrefix(p string, s map[string]string) bool {
914 lp := len(p)
915 for prefix := range s {
916 if l := len(prefix); lp > l+1 && p[:l] == prefix && p[l] == '/' {
917 return true
918 }
919 }
920 return false
921}
922
923// hasSrcPrefix returns true if any of s is the prefix of p with /src/ or
924// /pkg/mod/.

Callers 1

findRootsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…