aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_sumdb_golang.txt
blob: 40a07fc7e9fe702094f0d3a46cb2e7595b22d6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Test default GOPROXY and GOSUMDB
env GOPROXY=
env GOSUMDB=
go env GOPROXY
stdout '^https://proxy.golang.org,direct$'
go env GOSUMDB
stdout '^sum.golang.org$'
env GOPROXY=https://proxy.golang.org
go env GOSUMDB
stdout '^sum.golang.org$'

# download direct from github
[!net] skip
[!exec:git] skip
env GOSUMDB=sum.golang.org
env GOPROXY=direct
go get -d rsc.io/quote@v1.5.2
cp go.sum saved.sum

# download from proxy.golang.org with go.sum entry already
go clean -modcache
env GOSUMDB=
env GOPROXY=
go get -x -d rsc.io/quote@v1.5.2
! stderr github
stderr proxy.golang.org/rsc.io/quote
! stderr sum.golang.org/tile
! stderr sum.golang.org/lookup/rsc.io/quote
cmp go.sum saved.sum

# Download again.
# Should use the checksum database to validate new go.sum lines,
# but not need to fetch any new data from the proxy.
rm go.sum
go get -x -d rsc.io/quote@v1.5.2
! stderr github
! stderr proxy.golang.org/rsc.io/quote
stderr sum.golang.org/tile
stderr sum.golang.org/lookup/rsc.io/quote
cmp go.sum saved.sum

# test fallback to direct
env TESTGOPROXY404=1
go clean -modcache
rm go.sum
go get -x -d rsc.io/quote@v1.5.2
stderr 'proxy.golang.org.*404 testing'
stderr github.com/rsc
cmp go.sum saved.sum

-- go.mod --
module m