summaryrefslogtreecommitdiff
path: root/src/pattern.go
diff options
context:
space:
mode:
authorRyan Boehning <ryanboehning@gmail.com>2018-02-17 14:01:06 -0800
committerJunegunn Choi <junegunn.c@gmail.com>2018-03-13 14:56:55 +0900
commit21b94d2de5bdf2d8c4e8107e4c197a2abc1e7275 (patch)
treed7255fcd66e512a40016ac220d84574f22c0d551 /src/pattern.go
parent24236860c89242ac0a341ff911c93f25032dc051 (diff)
downloadfzf-21b94d2de5bdf2d8c4e8107e4c197a2abc1e7275.tar.gz
Make fzf pass go vet
Add String() methods to types, so they can be printed with %s. Change some %s format specifiers to %v, when the default string representation is good enough. In Go 1.10, `go test` triggers a parallel `go vet`. So this also makes fzf pass `go test`. Close #1236 Close #1219
Diffstat (limited to 'src/pattern.go')
-rw-r--r--src/pattern.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pattern.go b/src/pattern.go
index 636ae1ee..2627dea6 100644
--- a/src/pattern.go
+++ b/src/pattern.go
@@ -1,6 +1,7 @@
package fzf
import (
+ "fmt"
"regexp"
"strings"
@@ -34,6 +35,11 @@ type term struct {
caseSensitive bool
}
+// String returns the string representation of a term.
+func (t term) String() string {
+ return fmt.Sprintf("term{typ: %d, inv: %v, text: []rune(%q), caseSensitive: %v}", t.typ, t.inv, string(t.text), t.caseSensitive)
+}
+
type termSet []term
// Pattern represents search pattern