From 73df946d56c74384511a194dd01dbe099584fd1a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 15:14:23 +0200 Subject: Adding upstream version 1.16.10. Signed-off-by: Daniel Baumann --- src/cmd/go/testdata/script/mod_gonoproxy.txt | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/cmd/go/testdata/script/mod_gonoproxy.txt (limited to 'src/cmd/go/testdata/script/mod_gonoproxy.txt') diff --git a/src/cmd/go/testdata/script/mod_gonoproxy.txt b/src/cmd/go/testdata/script/mod_gonoproxy.txt new file mode 100644 index 0000000..2047869 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_gonoproxy.txt @@ -0,0 +1,54 @@ +env GO111MODULE=on +env sumdb=$GOSUMDB +env proxy=$GOPROXY +env GOPRIVATE GOPROXY GONOPROXY GOSUMDB GONOSUMDB +env dbname=localhost.localdev/sumdb + +# disagree with sumdb fails +cp go.mod.orig go.mod +env GOSUMDB=$sumdb' '$proxy/sumdb-wrong +! go get -d rsc.io/quote +stderr 'SECURITY ERROR' + +# GONOSUMDB bypasses sumdb, for rsc.io/quote, rsc.io/sampler, golang.org/x/text +env GONOSUMDB='*/quote,*/*mple*,golang.org/x' +go get -d rsc.io/quote +rm go.sum +env GOPRIVATE='*/quote,*/*mple*,golang.org/x' +env GONOPROXY=none # that is, proxy all despite GOPRIVATE +go get -d rsc.io/quote + +# Download .info files needed for 'go list -m all' later. +# TODO(#42723): either 'go list -m' should not read these files, +# or 'go get' and 'go mod tidy' should download them. +go list -m all +stdout '^golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c$' + +# When GOPROXY is not empty but contains no entries, an error should be reported. +env GOPROXY=',' +! go get -d golang.org/x/text +stderr '^go get golang.org/x/text: GOPROXY list is not the empty string, but contains no entries$' + +# When GOPROXY=off, fetching modules not matched by GONOPROXY fails. +env GONOPROXY=*/fortune +env GOPROXY=off +! go get -d golang.org/x/text +stderr '^go get golang.org/x/text: module lookup disabled by GOPROXY=off$' + +# GONOPROXY bypasses proxy +[!net] skip +[!exec:git] skip +env GOPRIVATE=none +env GONOPROXY='*/fortune' +! go get -d rsc.io/fortune # does not exist in real world, only on test proxy +stderr 'git ls-remote' + +env GOSUMDB= +env GONOPROXY= +env GOPRIVATE='*/x' +go get -d golang.org/x/text +go list -m all +! stdout 'text.*v0.0.0-2017' # should not have the version from the proxy + +-- go.mod.orig -- +module m -- cgit v1.2.3