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

x/tools/cmd/getgo: uses incorrect "latest" url #42676

Open
fmpwizard opened this issue Nov 17, 2020 · 3 comments
Open

x/tools/cmd/getgo: uses incorrect "latest" url #42676

fmpwizard opened this issue Nov 17, 2020 · 3 comments
Labels
Milestone

Comments

@fmpwizard
Copy link

@fmpwizard fmpwizard commented Nov 17, 2020

What version of Go are you using (go version)?

$ go version
1.5.55

But the golang/tools commit that has this problem is the latest as of today 2020/11/17

9036a0f9af11674fea137b794a0a2e6aef6882e1

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Not relevant but:

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wizard/.cache/go-build"
GOENV="/home/wizard/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/mnt/extra/gopath/pkg/mod"
GONOPROXY="github.com/tradellama"
GONOSUMDB="github.com/tradellama"
GOOS="linux"
GOPATH="/mnt/extra/gopath"
GOPRIVATE="github.com/tradellama"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/mnt/extra/code/work/tradellama/goat/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build370880754=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer -i
  2. Got:

Welcome to the Go installer!
Would you like to install Go? Y/n [Y]: y
The latest go version is go1.15.4, install that? Y/n [Y]:

What did you expect to see?

go1.15.5 being offered

What did you see instead?

go.1.15.4

Possible fix:

this line

https://github.com/golang/tools/blob/master/cmd/getgo/download.go#L24

gets the version that the golang.org site "runs" but at this this time, the site doesn't run the latest. We should instead use:

https://golang.org/dl/?mode=json

Which was suggested on the mailing list
https://groups.google.com/g/golang-nuts/c/kweFo4TE4N0/m/XyH-tI0OBQAJ

@gopherbot gopherbot added the Tools label Nov 17, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 17, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 17, 2020

Change https://golang.org/cl/270878 mentions this issue: x/tools/getgo: get current version from correct url

@dmitshur dmitshur changed the title x/tools/getgo uses incorrect "latest" url x/tools/getgo: uses incorrect "latest" url Nov 30, 2020
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Nov 30, 2020

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Nov 30, 2020

I agree that switching it to use the https://golang.org/dl/?mode=json API endpoint is the right fix.

@dmitshur dmitshur changed the title x/tools/getgo: uses incorrect "latest" url x/tools/cmd/getgo: uses incorrect "latest" url Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants