diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 20:54:26 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-11 20:54:26 +0300 |
| commit | d3bbb859d52b45987e3cd2098e28423f32edd999 (patch) | |
| tree | 4265893d0c665ba0e763482a70c9044fa983a1ed /match/prefix.go | |
| parent | dd2171d085ef5957a1c5c0794d6007822e47849b (diff) | |
| parent | ba23c350c73d2dfdf071c14c22152bcaf7e7fd7b (diff) | |
Merge pull request #12 from posener/improves
Enhance program structure and data structures
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) } |
