...

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

Documentation: cmd/go/testdata/script

     1env GO111MODULE=on
     2env proxy=$GOPROXY
     3
     4# Proxy that can't serve should fail.
     5env GOPROXY=$proxy/404
     6! go get rsc.io/quote@v1.0.0
     7stderr '404 Not Found'
     8
     9# get should walk down the proxy list past 404 and 410 responses.
    10env GOPROXY=$proxy/404,$proxy/410,$proxy
    11go get rsc.io/quote@v1.1.0
    12
    13# get should not walk past other 4xx errors if proxies are separated with ','.
    14env GOPROXY=$proxy/403,$proxy
    15! go get rsc.io/quote@v1.2.0
    16stderr 'reading.*/403/rsc.io/.*: 403 Forbidden'
    17
    18# get should not walk past non-4xx errors if proxies are separated with ','.
    19env GOPROXY=$proxy/500,$proxy
    20! go get rsc.io/quote@v1.3.0
    21stderr 'reading.*/500/rsc.io/.*: 500 Internal Server Error'
    22
    23# get should walk past other 4xx errors if proxies are separated with '|'.
    24env GOPROXY=$proxy/403|https://0.0.0.0|$proxy
    25go get rsc.io/quote@v1.2.0
    26
    27# get should walk past non-4xx errors if proxies are separated with '|'.
    28env GOPROXY=$proxy/500|https://0.0.0.0|$proxy
    29go get rsc.io/quote@v1.3.0
    30
    31# get should return the final error if that's all we have.
    32env GOPROXY=$proxy/404,$proxy/410
    33! go get rsc.io/quote@v1.4.0
    34stderr 'reading.*/410/rsc.io/.*: 410 Gone'
    35
    36-- go.mod --
    37module x

View as plain text