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

proposal: dl: consider supporting specifying download address prefixes #61291

Closed
notobject opened this issue Jul 11, 2023 · 0 comments
Closed
Labels
Milestone

Comments

@notobject
Copy link

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

$ go version
go version go1.16.2 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/sangfor/.cache/go-build"
GOENV="/home/sangfor/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/sangfor/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/sangfor/go"
GOPRIVATE=""
GOPROXY="http://mirrors.sangfor.org/nexus/repository/go-proxy"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/sangfor/go/pkg/mod/golang.org/dl@v0.0.0-20230629133730-ba866d363753/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-build2133268110=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Installing multiple Go versions

$ go install golang.org/dl/go1.20@latest
$ go1.20 download

What did you expect to see?

I hope that the address for downloading the installation package (https://dl.google.com/go/) can be customized, like GOPROXY, because my development environment cannot connect to dl.google.com/go, but we have a mirror site can replace it.

What did you see instead?

I got an error:
go1.20: download failed: Head "https://dl.google.com/go/go1.20.linux-amd64.tar.gz": dial tcp 172.217.24.110:443: i/o timeout

and i found a hardcoded address at

dl/internal/version/version.go versionArchiveURL
// versionArchiveURL returns the zip or tar.gz URL of the given Go version.
func versionArchiveURL(version string) string {
        goos := getOS()
    ext := ".tar.gz"
    if goos == "windows" {
            ext = ".zip"
    }
    arch := runtime.GOARCH
    if goos == "linux" && runtime.GOARCH == "arm" {
            arch = "armv6l"
    }
    return "https://dl.google.com/go/" + version + "." + goos + "-" + arch + ext

}

@notobject notobject changed the title dl: Consider supporting specifying download address prefixes proposal: dl: consider supporting specifying download address prefixes Jul 11, 2023
@gopherbot gopherbot added this to the Proposal milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants