Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go version missing from documentations. #37

Closed
MonishAkram opened this issue Jun 15, 2020 · 4 comments · Fixed by #47
Closed

Go version missing from documentations. #37

MonishAkram opened this issue Jun 15, 2020 · 4 comments · Fixed by #47

Comments

@MonishAkram
Copy link

I'm using golang v1.12 but this package is not supported because of errors.Is and errors.As functions which are not present in v1.12 and was added in v1.13. And there is no version requirement mentioned in the documentation. for this package

@IngCr3at1on
Copy link

IngCr3at1on commented Sep 11, 2020

Counterpoint: the go team themselves doesn't even support farther back than 2 versions, 1.14 was released in February which means even at the time of writing this issue 1.12 was not officially supported by the go team; is there a reason this package should support more than what is officially supported (assuming no, there is no reason to assume anything before 1.13 would work, with the release of 1.15 in August that would actually be 1.14 as the earliest officially supported version of Go)?

@webmaster777
Copy link

webmaster777 commented Oct 2, 2020

Having random errors like

> go get -u github.com/mattermost/mmctl
# github.com/mattermost/mmctl/vendor/github.com/hashicorp/go-multierror
go/src/github.com/mattermost/mmctl/vendor/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As
go/src/github.com/mattermost/mmctl/vendor/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is

How does one tell I need to upgrade go? I have no idea how package mangagement works in Go, but I'm used to version constraint explanations in other langs/package managers (js/php) etc.

@mwhooker
Copy link
Contributor

mwhooker commented Oct 2, 2020

Hmm, yeah this should be documented. FWIW, v1.0.0 supports go < 1.13, while v1.1.0 requires go 1.13.

I also notice that in the go.mod file, the line go 1.14. This indicates that the module requires go 1.14. Infact, when I build this using go 1.12, I get the following error:

root@f97226dc12fd:/go/src/github.com/mwhooker/testmultierror# go run main.go
go: finding github.com/hashicorp/go-multierror v1.1.0
go: downloading github.com/hashicorp/go-multierror v1.1.0
go: extracting github.com/hashicorp/go-multierror v1.1.0
go: finding github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/hashicorp/errwrap v1.0.0
go: extracting github.com/hashicorp/errwrap v1.0.0
# github.com/hashicorp/go-multierror
/go/pkg/mod/github.com/hashicorp/go-multierror@v1.1.0/multierror.go:112:9: undefined: errors.As
/go/pkg/mod/github.com/hashicorp/go-multierror@v1.1.0/multierror.go:117:9: undefined: errors.Is
**note: module requires Go 1.14**

(emphasis mine).

Of course, because there's this ticket, this doesn't seem sufficient, but the requirement does exist. I would be happy to review any PRs that came in for documenting the required go version

Edit: ahh, I think the behavior I see above (where it says the module requires go 1.14) was added in a later version of go than you might be using @webmaster777, so you didn't see the message. I think we should still document it, but my advice would be to use a version of go at most one "major" version out of date. To quote from the go release page:

Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.

@ggirtsou
Copy link

Fixed after upgrading to Go 1.15. I was importing spf13/viper and golang-migrate packages in my Go vendor directory (they require different version of go-multierror).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants