hashicorp / go-multierror

A Go (golang) package for representing a list of errors as a single error.
Mozilla Public License 2.0
2.3k stars 123 forks source link

Build error triggered from the mxpv/podsync makefile #38

Closed elsiehupp closed 3 years ago

elsiehupp commented 4 years ago

I am trying to build mxpv/podsync using its makefile, and I am getting this error:

# github.com/hashicorp/go-multierror ../go/src/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As ../go/src/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is

I know basically nothing about go, but as far as I can tell this shouldn't be happening. Is this a bug in the podsync makefile, or is it a bug in multierror.go?

I would appreciate the attention of someone who understands these things better than I. Thanks!

(For further context, see my issue on the podsync repository here.)

jefferai commented 4 years ago

You need to be using Go 1.13 or higher as that's when the errors package was introduced.

elsiehupp commented 4 years ago

You need to be using Go 1.13 or higher as that's when the errors package was introduced.

Thanks for the explainer! Do you think it would be possible for someone to update the code so that it would produce a more useful error message when trying to build it with the wrong version of go?

mwhooker commented 3 years ago

Hi @elsiehupp, sorry you had this problem. Unfortunately there's not much we can do to make the error more apparent. However, later versions of go do say when you're using a version of go that the module doesn't support. I think we should track this as a documentation request, and so am going to close it as a duplicate of #37

I'll also copy some thoughts I shared over in that other ticket: 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.