Closed stevelizcano closed 2 years ago
Hi, I'm not sure why you get that error, but I can assure you that the module configuration of this library is in order. I just tried with go 1.17:
/tmp $ mkdir survey-test
/tmp $ cd survey-test
/tmp/survey-test $ go mod init github.com/mislav/survey-test
go: creating new go.mod: module github.com/mislav/survey-test
/tmp/survey-test $ go get -u github.com/AlecAivazis/survey/v2
go: downloading golang.org/x/text v0.3.7
go: downloading golang.org/x/sys v0.0.0-20211124211545-fe61309f8881
go get: added github.com/AlecAivazis/survey/v2 v2.3.2
go get: added github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
go get: added github.com/mattn/go-colorable v0.1.12
go get: added github.com/mattn/go-isatty v0.0.14
go get: added github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go get: added golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
go get: added golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go get: added golang.org/x/text v0.3.3
/tmp/survey-test $ cat go.mod
module github.com/mislav/survey-test
go 1.17
require (
github.com/AlecAivazis/survey/v2 v2.3.2 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
golang.org/x/text v0.3.3 // indirect
)
/tmp/survey-test $ cat main.go
package main
import _ "github.com/AlecAivazis/survey/v2"
func main() {
}
/tmp/survey-test $ go build main.go
/tmp/survey-test $ ./main
[no errors]
It might be that something regarding modules in your app is broken; perhaps an out-of-date vendor directory? Anyway, I'm going to close this, because this looks like an app-specific problem rather than a problem with this library.
Thanks @mislav , I double checked and I think it was a go mod vendor
problem. Thanks for checking!
What operating system and terminal are you using? MacOS 12.0.1 Monterey An example that showcases the bug.
And then when using it the following error occurs:
What did you expect to see?
Import working
What did you see instead?