1 package gitignore 2 3 import "path/filepath" 4 5 type pathMatcher interface { 6 match(path string) bool 7 } 8 9 type simpleMatcher struct { 10 path string 11 } 12 13 func (m simpleMatcher) match(path string) bool { 14 return m.path == path 15 } 16 17 type filepathMatcher struct { 18 path string 19 } 20 21 func (m filepathMatcher) match(path string) bool { 22 match, _ := filepath.Match(m.path, path) 23 return match 24 } 25