diff options
Diffstat (limited to 'bug')
-rw-r--r-- | bug/person.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bug/person.go b/bug/person.go index 674da9f2..9afaac0d 100644 --- a/bug/person.go +++ b/bug/person.go @@ -2,6 +2,7 @@ package bug import ( "errors" + "strings" "github.com/MichaelMure/git-bug/repository" ) @@ -31,3 +32,8 @@ func GetUser(repo repository.Repo) (Person, error) { return Person{Name: name, Email: email}, nil } + +// Match tell is the Person match the given query string +func (p Person) Match(query string) bool { + return strings.Contains(strings.ToLower(p.Name), strings.ToLower(query)) +} |