hasSrcPrefix returns true if any of s is the prefix of p with /src/ or pkg/mod/.
(p string, s map[string]string)
| 923 | // hasSrcPrefix returns true if any of s is the prefix of p with /src/ or |
| 924 | // /pkg/mod/. |
| 925 | func 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. |
| 942 | func getFiles(goroutines []*Goroutine) []string { |
no outgoing calls
no test coverage detected
searching dependent graphs…