go version
)?1.13.0
Yes
Trying to build my project after upgrading to Golang 1.13.0
And I get those errors:
vendor/golang.org/x/xerrors/adaptor_go1_13.go:16:14: undefined: errors.Frame
vendor/golang.org/x/xerrors/format_go1_13.go:12:18: undefined: errors.Formatter
I saw a related issue there: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240319
But I don't understand what could help me to fix? It seems on Golang side no?
Thank you,
You need to update your vendored golang.org/x/xerrors package. It was updated for a preliminary version of Go 1.13, but the final Go 1.13 release changed. xerrors was corrected for that change in May, 2019, and you are missing that correction.
@ianlancetaylor I have deleted all my cache (/go/pkg/mod/
and also /go/src
) but the problem persists.
That's the same when building inside a clean Jenkins pipeline.
In my go.sum
file I can see:
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522 h1:bhOzK9QyoD0ogCnFro1m2mz41+Ib0oOhfJnBp5MR4K4=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
馃槩
EDIT: or maybe you are talking about a manual update somewhere? Like a replace
inside the go.mod
file? Because in my case, I never made a reference to the xerrors
package so I was expecting upgrading to 1.13 and having a fresh environment would make it working.
@sneko 3ee3066db522
is not the latest version of golang.org/x/xerrors
. You need version golang/xerrors@a985d3407aa71f30cf86696ee0a2f409709f22e1.
I had the same problem and go get -u golang.org/x/xerrors
did the trick.
xerrors is not part of a Go release. It is from the repo golang.org/x/xerrors. That repo exists independently and is not updated as part of a Go release.
Thank you both for your answers 馃槂!
In my case, this is due to a dependency code (https://github.com/google/go-cloud/commit/31e061dd5727ffc5064e16da45f7779b806ff82d) not yet released.
Most helpful comment
@sneko
3ee3066db522
is not the latest version ofgolang.org/x/xerrors
. You need version golang/xerrors@a985d3407aa71f30cf86696ee0a2f409709f22e1.I had the same problem and
go get -u golang.org/x/xerrors
did the trick.