...
1env GO111MODULE=on
2env sumdb=$GOSUMDB
3env proxy=$GOPROXY
4env GOPROXY GONOPROXY GOSUMDB GONOSUMDB
5
6# rejected proxy fails verification
7cp go.mod.orig go.mod
8rm go.sum
9env GOPROXY=$proxy/sumdb-503
10! go get rsc.io/quote
11stderr 503
12
13# fetch through working proxy is OK
14cp go.mod.orig go.mod
15rm go.sum
16env GOPROXY=$proxy
17go get rsc.io/quote
18
19# repeated fetch works entirely from cache, does not consult sumdb
20cp go.mod.orig go.mod
21rm go.sum
22env GOPROXY=$proxy/sumdb-503
23go get rsc.io/quote
24rm go.sum
25
26# fetch specific module can work without proxy, using cache or go.sum
27cp go.mod.orig go.mod
28rm go.sum
29env GOPROXY=off
30go get rsc.io/quote@v1.5.2 # using cache
31rm $GOPATH/pkg/mod/cache/download/sumdb/localhost.localdev/sumdb/lookup/rsc.io/quote@v1.5.2
32go get rsc.io/quote@v1.5.2 # using go.sum
33
34# fetch fails once we lose access to both cache and go.sum
35rm go.sum
36env GOPROXY=$proxy/sumdb-504
37! go get rsc.io/quote@v1.5.2
38stderr 504
39
40# GOINSECURE does not bypass checksum lookup
41env GOINSECURE=rsc.io
42env GOPROXY=$proxy/sumdb-504
43! go get rsc.io/quote@v1.5.2
44stderr 504
45
46-- go.mod.orig --
47module m
View as plain text