diff options
| author | Eyal Posener <[email protected]> | 2017-11-04 11:52:09 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-04 11:52:09 +0200 |
| commit | 00c86494ff7035cfd62f66042e9ca2b118b90122 (patch) | |
| tree | b507c4736c6f8de2e887e76b952961d1c8dcc44c /gocomplete/tests.go | |
| parent | 88e59760adaddb8276c9b15511302890690e2dae (diff) | |
| parent | c45e6fe8516b89faca97fc3a485949a07a9530c7 (diff) | |
Merge pull request #53 from posener/finally-filter-matches
Filter matches as a final stage
Diffstat (limited to 'gocomplete/tests.go')
| -rw-r--r-- | gocomplete/tests.go | 11 |
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) }) } |
