summaryrefslogtreecommitdiff
path: root/gocomplete/tests.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-11-04 11:52:49 +0200
committerGitHub <[email protected]>2017-11-04 11:52:49 +0200
commita1f9ea005b8360153429321071da4e42ce6ce323 (patch)
tree0f7976f712f3cb3c70eac8eb78b5027e445e16c8 /gocomplete/tests.go
parentaae7e1e39fb3554591e2d20b4c86fea9bf2b15bc (diff)
parent00c86494ff7035cfd62f66042e9ca2b118b90122 (diff)
Merge branch 'master' into split-last-equal
Diffstat (limited to 'gocomplete/tests.go')
-rw-r--r--gocomplete/tests.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/gocomplete/tests.go b/gocomplete/tests.go
index a952dab..e755ae5 100644
--- a/gocomplete/tests.go
+++ b/gocomplete/tests.go
@@ -7,7 +7,6 @@ import (
"strings"
"github.com/posener/complete"
- "github.com/posener/complete/match"
)
var (
@@ -21,14 +20,8 @@ var (
// for test names use prefix of 'Test' or 'Example', and for benchmark
// test names use 'Benchmark'
func funcPredict(funcRegexp *regexp.Regexp) complete.Predictor {
- return complete.PredictFunc(func(a complete.Args) (prediction []string) {
- tests := funcNames(funcRegexp)
- for _, t := range tests {
- if match.Prefix(t, a.Last) {
- prediction = append(prediction, t)
- }
- }
- return
+ return complete.PredictFunc(func(a complete.Args) []string {
+ return funcNames(funcRegexp)
})
}