summaryrefslogtreecommitdiff
path: root/match.go
diff options
context:
space:
mode:
Diffstat (limited to 'match.go')
-rw-r--r--match.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/match.go b/match.go
index 7593d65..8da8f2c 100644
--- a/match.go
+++ b/match.go
@@ -20,6 +20,7 @@ func (a MatchPrefix) String() string {
return string(a)
}
+// Match returns true if a has the prefix as prefix
func (a MatchPrefix) Match(prefix string) bool {
return strings.HasPrefix(string(a), prefix)
}
@@ -32,6 +33,7 @@ func (a MatchFileName) String() string {
return string(a)
}
+// Match returns true if prefix's abs path prefixes a's abs path
func (a MatchFileName) Match(prefix string) bool {
full, err := filepath.Abs(string(a))
if err != nil {