hasPrefix returns true if any of s is the prefix of p.
(p string, s map[string]string)
| 911 | |
| 912 | // hasPrefix returns true if any of s is the prefix of p. |
| 913 | func 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/. |
no outgoing calls
no test coverage detected
searching dependent graphs…