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

Function hasSrcPrefix

stack/context.go:925–939  ·  view source on GitHub ↗

hasSrcPrefix returns true if any of s is the prefix of p with /src/ or pkg/mod/.

(p string, s map[string]string)

Source from the content-addressed store, hash-verified

923// hasSrcPrefix returns true if any of s is the prefix of p with /src/ or
924// /pkg/mod/.
925func hasSrcPrefix(p string, s map[string]string) bool {
926 lp := len(p)
927 const src = "/src/"
928 const pkgmod = "/pkg/mod/"
929 for prefix := range s {
930 l := len(prefix)
931 if lp > l+len(src) && p[:l] == prefix && p[l:l+len(src)] == src {
932 return true
933 }
934 if lp > l+len(pkgmod) && p[:l] == prefix && p[l:l+len(pkgmod)] == pkgmod {
935 return true
936 }
937 }
938 return false
939}
940
941// getFiles returns all the source files deduped and ordered.
942func getFiles(goroutines []*Goroutine) []string {

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…