(path []string, isDir bool)
| 76 | } |
| 77 | |
| 78 | func (p *pattern) Match(path []string, isDir bool) MatchResult { |
| 79 | if len(path) <= len(p.domain) { |
| 80 | return NoMatch |
| 81 | } |
| 82 | for i, e := range p.domain { |
| 83 | if path[i] != e { |
| 84 | return NoMatch |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | path = path[len(p.domain):] |
| 89 | if p.isGlob && !p.globMatch(path, isDir) { |
| 90 | return NoMatch |
| 91 | } else if !p.isGlob && !p.simpleNameMatch(path, isDir) { |
| 92 | return NoMatch |
| 93 | } |
| 94 | |
| 95 | if p.inclusion { |
| 96 | return Include |
| 97 | } else { |
| 98 | return Exclude |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func (p *pattern) simpleNameMatch(path []string, isDir bool) bool { |
| 103 | for i, name := range path { |
nothing calls this directly
no test coverage detected