(path []string, isDir bool)
| 100 | } |
| 101 | |
| 102 | func (p *pattern) simpleNameMatch(path []string, isDir bool) bool { |
| 103 | for i, name := range path { |
| 104 | if match, err := filepath.Match(p.pattern[0], name); err != nil { |
| 105 | return false |
| 106 | } else if !match { |
| 107 | continue |
| 108 | } |
| 109 | if p.dirOnly && !isDir && i == len(path)-1 { |
| 110 | return false |
| 111 | } |
| 112 | return true |
| 113 | } |
| 114 | return false |
| 115 | } |
| 116 | |
| 117 | func (p *pattern) globMatch(path []string, isDir bool) bool { |
| 118 | matched := false |