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