Function
isValidComponentMatcher
(componentLen, wildcardLen int)
Source from the content-addressed store, hash-verified
| 61 | } |
| 62 | |
| 63 | func isValidComponentMatcher(componentLen, wildcardLen int) bool { |
| 64 | if wildcardLen > 2 { |
| 65 | // No more than two wildcards per component |
| 66 | return false |
| 67 | } |
| 68 | if wildcardLen > 0 && wildcardLen != componentLen { |
| 69 | // Wildcard can't be mixed with other characters in the same component |
| 70 | return false |
| 71 | } |
| 72 | // Component must not be empty |
| 73 | return componentLen > 0 |
| 74 | } |
| 75 | |
| 76 | func isValidPatternRune(c rune) bool { |
| 77 | return isValidRune(c) || c == '*' |
Tested by
no test coverage detected