]> Cypherpunks repositories - gostls13.git/commit
cmd/go: rank errUseProxy lower when handling proxy errors
authorJay Conrod <jayconrod@google.com>
Wed, 20 May 2020 21:54:55 +0000 (17:54 -0400)
committerJay Conrod <jayconrod@google.com>
Thu, 21 May 2020 14:31:37 +0000 (14:31 +0000)
commit0cfe1fb87815c4bee910f6f066f7872800dbce24
treeade2dcf369ebbe2d0572550daca15ba4e677657d
parentc53b2bdb35c5339df35b53c8fbf34e5cbede081f
cmd/go: rank errUseProxy lower when handling proxy errors

modfetch.TryProxies ranks errors returned by GOPROXY entries by
usefulness. It returns the error of the highest rank from the last
proxy. Errors from "direct" and "noproxy" are most useful, followed by
errors other than ErrNotExist, followed by ErrNotExist.

This change ranks errUseProxy with ErrNotExist even though it's
reported by "noproxy". There is almost always a more useful message
than "path does not match GOPRIVATE/GONOPROXY".

Fixes #39180

Change-Id: Ifa5b96462d7bf411e6d2d951888465c839d42471
Reviewed-on: https://go-review.googlesource.com/c/go/+/234687
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/internal/modfetch/proxy.go
src/cmd/go/testdata/script/mod_gonoproxy.txt