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

website: go1.22.0.linux-amd64.tar.gz contains wrong go version (go1.21.4) #65837

Closed
boutros opened this issue Feb 21, 2024 · 8 comments
Closed

Comments

@boutros
Copy link

boutros commented Feb 21, 2024

Go version

go1.21.4

Output of go env in your module/workspace:

not used

What 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

@mpx
Copy link
Contributor

mpx commented Feb 21, 2024

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

@gophun
Copy link

gophun commented Feb 21, 2024

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

@boutros
Copy link
Author

boutros commented Feb 21, 2024

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

@gophun
Copy link

gophun commented Feb 21, 2024

@boutros
go env GOTOOLCHAIN?

@boutros
Copy link
Author

boutros commented Feb 21, 2024

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

@boutros
Copy link
Author

boutros commented Feb 21, 2024

Case closed. Works now, after I runrm /home/boutros/.config/go/env

@boutros boutros closed this as completed Feb 21, 2024
@boutros
Copy link
Author

boutros commented Feb 21, 2024

Thanks for your help :)

@mpx
Copy link
Contributor

mpx commented Feb 22, 2024

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.

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

No branches or pull requests

3 participants