]> Cypherpunks repositories - gostls13.git/commit
cmd/go: respect default proxy setting, add direct fallback
authorRuss Cox <rsc@golang.org>
Fri, 24 May 2019 12:55:30 +0000 (08:55 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 24 May 2019 21:34:53 +0000 (21:34 +0000)
commit385b2e0caccbb5da73b940a756c043a0aaa2d5a8
tree0000280e256ae6384f0064496417de08d97160f2
parentc7385e270473244ef5aa312a172f1912e99800be
cmd/go: respect default proxy setting, add direct fallback

Getenv("GOPROXY") says what the environment variable is
(including looking in the go env file), but it doesn't include
the default setting. This code needs to use cfg.GOPROXY
to get the actual default. Fix and test that.

Also, we forgot to include the fallback to direct for when
the proxy serves a 404. Add and test that too.

Also add HTTP fetch information to -x build flag output.
(It does not belong in the -v output, despite the GOPATH go get
command doing this.)

Change-Id: Ieab7ef13cda3e1ad041dbe04921af206e2232c9c
Reviewed-on: https://go-review.googlesource.com/c/go/+/178720
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/web/http.go
src/cmd/go/testdata/script/get_insecure_redirect.txt
src/cmd/go/testdata/script/mod_get_private_vcs.txt
src/cmd/go/testdata/script/mod_git_export_subst.txt
src/cmd/go/testdata/script/mod_sumdb_golang.txt
src/cmd/go/testdata/script/mod_vcs_missing.txt