Closed
Description
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
Activity
mpx commentedon Feb 21, 2024
Please recheck. That seems incredibly unlikely and I can't reproduce it myself. You should have:
gophun commentedon 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:boutros commentedon Feb 21, 2024
Strange, I tried again, same result. Here is the full terminal session:
gophun commentedon Feb 21, 2024
@boutros
go env GOTOOLCHAIN
?boutros commentedon 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 commentedon Feb 21, 2024
Case closed. Works now, after I run
rm /home/boutros/.config/go/env
boutros commentedon Feb 21, 2024
Thanks for your help :)
mpx commentedon 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.