Text file src/cmd/go/testdata/script/mod_sumdb_cache.txt

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

View as plain text