Skip to content

Commit

Permalink
Fix failing go1.16 test
Browse files Browse the repository at this point in the history
Fixes #132
  • Loading branch information
posener committed Jan 30, 2021
1 parent 246bd25 commit 5d9f7f1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 39 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/posener/complete/v2

require (
bou.ke/monkey v1.0.2
github.com/hashicorp/go-multierror v1.0.0
github.com/posener/autogen v0.0.2
github.com/posener/script v1.1.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI=
bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
Expand Down
78 changes: 39 additions & 39 deletions gocomplete/complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,14 @@ func main() {

modHelp := &complete.Command{
Sub: map[string]*complete.Command{
"download": &complete.Command{},
"edit": &complete.Command{},
"graph": &complete.Command{},
"init": &complete.Command{},
"tidy": &complete.Command{},
"vendor": &complete.Command{},
"verify": &complete.Command{},
"why": &complete.Command{},
"download": {},
"edit": {},
"graph": {},
"init": {},
"tidy": {},
"vendor": {},
"verify": {},
"why": {},
},
}

Expand All @@ -563,38 +563,38 @@ func main() {

help := &complete.Command{
Sub: map[string]*complete.Command{
"bug": &complete.Command{},
"build": &complete.Command{},
"clean": &complete.Command{},
"doc": &complete.Command{},
"env": &complete.Command{},
"fix": &complete.Command{},
"fmt": &complete.Command{},
"generate": &complete.Command{},
"get": &complete.Command{},
"install": &complete.Command{},
"list": &complete.Command{},
"bug": {},
"build": {},
"clean": {},
"doc": {},
"env": {},
"fix": {},
"fmt": {},
"generate": {},
"get": {},
"install": {},
"list": {},
"mod": modHelp,
"run": &complete.Command{},
"test": &complete.Command{},
"tool": &complete.Command{},
"version": &complete.Command{},
"vet": &complete.Command{},
"buildmode": &complete.Command{},
"c": &complete.Command{},
"cache": &complete.Command{},
"environment": &complete.Command{},
"filetype": &complete.Command{},
"go.mod": &complete.Command{},
"gopath": &complete.Command{},
"gopath-get": &complete.Command{},
"goproxy": &complete.Command{},
"importpath": &complete.Command{},
"modules": &complete.Command{},
"module-get": &complete.Command{},
"packages": &complete.Command{},
"testflag": &complete.Command{},
"testfunc": &complete.Command{},
"run": {},
"test": {},
"tool": {},
"version": {},
"vet": {},
"buildmode": {},
"c": {},
"cache": {},
"environment": {},
"filetype": {},
"go.mod": {},
"gopath": {},
"gopath-get": {},
"goproxy": {},
"importpath": {},
"modules": {},
"module-get": {},
"packages": {},
"testflag": {},
"testfunc": {},
},
}

Expand Down
2 changes: 2 additions & 0 deletions gocomplete/tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sort"
"testing"

"bou.ke/monkey"
"github.com/posener/complete/v2"
)

Expand Down Expand Up @@ -42,6 +43,7 @@ func TestPredictions(t *testing.T) {
func BenchmarkFake(b *testing.B) {}

func Example() {
monkey.Patch(os.Exit, func(int) {})
os.Setenv("COMP_LINE", "go ru")
os.Setenv("COMP_POINT", "5")
main()
Expand Down

0 comments on commit 5d9f7f1

Please sign in to comment.