(path []string, isDir bool)
| 90 | } |
| 91 | |
| 92 | func (p *pattern) simpleNameMatch(path []string, isDir bool) bool { |
| 93 | for i, name := range path { |
| 94 | if match, err := filepath.Match(p.pattern[0], name); err != nil { |
| 95 | return false |
| 96 | } else if !match { |
| 97 | continue |
| 98 | } |
| 99 | if p.dirOnly && !isDir && i == len(path)-1 { |
| 100 | return false |
| 101 | } |
| 102 | return true |
| 103 | } |
| 104 | return false |
| 105 | } |
| 106 | |
| 107 | func (p *pattern) globMatch(path []string, isDir bool) bool { |
| 108 | matched := false |