Skip to content

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

Closed
@boutros

Description

@boutros

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

mpx commented on Feb 21, 2024

@mpx
Contributor

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

gophun commented on Feb 21, 2024

@gophun

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

boutros commented on Feb 21, 2024

@boutros
Author

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

gophun commented on Feb 21, 2024

@gophun

@boutros
go env GOTOOLCHAIN?

boutros

boutros commented on Feb 21, 2024

@boutros
Author

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

boutros commented on Feb 21, 2024

@boutros
Author

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

boutros

boutros commented on Feb 21, 2024

@boutros
Author

Thanks for your help :)

mpx

mpx commented on Feb 22, 2024

@mpx
Contributor

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.

locked and limited conversation to collaborators on Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @boutros@mpx@gopherbot@gophun

        Issue actions

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