Files
golang.go/src/cmd/go/testdata/script/mod_proxy_https.txt
Bryan C. Mills 2a2f99eefb cmd/go/internal/modload: do not resolve an arbitrary version for 'go list --versions'
If we don't actually require the listed module, we previously
implicitly resolved "latest", but also (erroneously) forgot to apply
exclusions and retractions for it. But there is really no need to
resolve "latest" in this case at all — now we omit the version from
the reported module info entirely.

Fixes #44296

Change-Id: Id595f52f597c7213bd65b73bf066a678d9e1d694
Reviewed-on: https://go-review.googlesource.com/c/go/+/297150
Trust: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2021-03-02 20:29:03 +00:00

21 lines
475 B
Plaintext

env GO111MODULE=on
# GOPROXY file paths must provide the "file://" prefix explicitly.
env GOPROXY=$WORK/proxydir
! go list -versions -m golang.org/x/text
stderr 'invalid proxy URL.*proxydir'
[!net] stop
# GOPROXY HTTPS paths may elide the "https://" prefix.
# (See golang.org/issue/32191.)
env GOPROXY=proxy.golang.org
env GOSUMDB=
go list -versions -m golang.org/x/text
-- go.mod --
module example.com
go 1.13
-- $WORK/proxydir/README.md --
This proxy contains no data.