MCPcopy Create free account
hub / github.com/go-task/task / simpleNameMatch

Method simpleNameMatch

internal/gitignore/pattern.go:102–115  ·  view source on GitHub ↗
(path []string, isDir bool)

Source from the content-addressed store, hash-verified

100}
101
102func (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
117func (p *pattern) globMatch(path []string, isDir bool) bool {
118 matched := false

Callers 1

MatchMethod · 0.95

Calls 1

MatchMethod · 0.65

Tested by

no test coverage detected