summaryrefslogtreecommitdiff
path: root/match/prefix.go
blob: d54902d6f365a6ab3b7c1746cec6ac9e021aa5f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package match

import "strings"

// Prefix is a simple Matcher, if the word is it's prefix, there is a match
type Prefix string

func (a Prefix) String() string {
	return string(a)
}

// Match returns true if a has the prefix as prefix
func (a Prefix) Match(prefix string) bool {
	return strings.HasPrefix(string(a), prefix)
}