StringHasPrefix returns true if value has one of the supplied prefixes.
(value string, prefixes ...string)
| 57 | |
| 58 | // StringHasPrefix returns true if value has one of the supplied prefixes. |
| 59 | func StringHasPrefix(value string, prefixes ...string) bool { |
| 60 | for _, prefix := range prefixes { |
| 61 | if strings.HasPrefix(value, prefix) { |
| 62 | return true |
| 63 | } |
| 64 | } |
| 65 | return false |
| 66 | } |
| 67 | |
| 68 | // StringPrefixInSlice returns true if any element in the list has the given prefix. |
| 69 | func StringPrefixInSlice(key string, list []string) bool { |
no outgoing calls
no test coverage detected
searching dependent graphs…