diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 20:48:40 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-11 20:48:40 +0300 |
| commit | 115e175c3d254b3a4797607821a0aab6f08058bb (patch) | |
| tree | 81a786eb45eef5c59f02bb8f731efaa1f926f97b /match/prefix.go | |
| parent | 967bae76f3132c210e6275653f9b603593973858 (diff) | |
Change Match to be a function
Diffstat (limited to 'match/prefix.go')
| -rw-r--r-- | match/prefix.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/match/prefix.go b/match/prefix.go index d54902d..9a01ba6 100644 --- a/match/prefix.go +++ b/match/prefix.go @@ -3,13 +3,7 @@ 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) +func Prefix(long, prefix string) bool { + return strings.HasPrefix(long, prefix) } |
