github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_sumdb_golang.txt (about) 1 # Test default GOPROXY and GOSUMDB 2 env GOPROXY= 3 env GOSUMDB= 4 go env GOPROXY 5 stdout '^https://proxy.golang.org,direct$' 6 go env GOSUMDB 7 stdout '^sum.golang.org$' 8 env GOPROXY=https://proxy.golang.org 9 go env GOSUMDB 10 stdout '^sum.golang.org$' 11 12 # download direct from github 13 [!net] skip 14 [!exec:git] skip 15 env GOSUMDB=sum.golang.org 16 env GOPROXY=direct 17 go get -d rsc.io/quote@v1.5.2 18 cp go.sum saved.sum 19 20 # download from proxy.golang.org with go.sum entry already 21 go clean -modcache 22 env GOSUMDB= 23 env GOPROXY= 24 go get -x -d rsc.io/quote@v1.5.2 25 ! stderr github 26 stderr proxy.golang.org/rsc.io/quote 27 ! stderr sum.golang.org/tile 28 ! stderr sum.golang.org/lookup/rsc.io/quote 29 cmp go.sum saved.sum 30 31 # Download again. 32 # Should use the checksum database to validate new go.sum lines, 33 # but not need to fetch any new data from the proxy. 34 rm go.sum 35 go get -x -d rsc.io/quote@v1.5.2 36 ! stderr github 37 ! stderr proxy.golang.org/rsc.io/quote 38 stderr sum.golang.org/tile 39 stderr sum.golang.org/lookup/rsc.io/quote 40 cmp go.sum saved.sum 41 42 # test fallback to direct 43 env TESTGOPROXY404=1 44 go clean -modcache 45 rm go.sum 46 go get -x -d rsc.io/quote@v1.5.2 47 stderr 'proxy.golang.org.*404 testing' 48 stderr github.com/rsc 49 cmp go.sum saved.sum 50 51 -- go.mod -- 52 module m