website: go1.22.0.linux-amd64.tar.gz contains wrong go version (go1.21.4)
boutros opened this issue ยท 8 comments
Go version
go1.21.4
Output of go env in your module/workspace:
not usedWhat did you do?
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
tar -xzf go1.22.0.linux-amd64.tar.g
./go/bin/go version
What did you see happen?
go version go1.21.4 linux/amd64
What did you expect to see?
go version go1.22 linux/amd64
Please recheck. That seems incredibly unlikely and I can't reproduce it myself. You should have:
$ tar xzf go1.22.0.linux-amd64.tar.gz
$ TZ=UTC ls -l go/bin/go
-rwxr-xr-x. 1 build build 12690016 Feb 2 18:09 go/bin/go
$ md5sum go/bin/go
d4af23c553e804b505b9d2717ce5c736 go/bin/go
$ go/bin/go version
go version go1.22.0 linux/amd64
Additionally, check the GOTOOLCHAIN setting, as different versions may be reported based on this setting, despite the initially invoked go binary being the same. For example:
$ go version
go version go1.22.0 darwin/arm64
$ GOTOOLCHAIN=go1.21.4 go version
go version go1.21.4 darwin/arm64
Strange, I tried again, same result. Here is the full terminal session:
11:51:49/tmp wget --quiet https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
11:52:09/tmp tar xzf go1.22.0.linux-amd64.tar.gz
11:52:23/tmp TZ=UTC ls -l go/bin/go
-rwxr-xr-x 1 boutros boutros 12690016 feb. 2 18:09 go/bin/go
11:52:33/tmp md5sum go/bin/go
d4af23c553e804b505b9d2717ce5c736 go/bin/go
11:52:43/tmp go/bin/go version
go version go1.21.4 linux/amd64
Allright, as @gophun suspects I guess its due to my environmment:
GOTOOLCHAIN='go1.21.4+auto'
Not sure how that got set.. But I will try to remove it somehow
Case closed. Works now, after I runrm /home/boutros/.config/go/env
Thanks for your help :)
This confusion is understandable - many Go users are probably unaware of GOTOOLCHAIN or how it works (#57001).
Perhaps this is an indication something could be improved to prevent this confusion around which version is running future? I don't like noisy commands, but maybe outputting a single line like "switching to goN.NN.NN" would be clearer and beneficial overall. Or maybe go version could output both versions (initial and switched).
Cc @rsc - for consideration.