-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
What version of Go are you using (go version
)?
$ go version go version go1.11.1 windows/386
What did you do?
I have a GOPROXY set up that will fetch from upstream. This lets me work within an otherwise internal-only corporate LAN. My GOPROXY is a simplified version of the Athens Project. It works quite well for repos from github.com and the like.
However, I would like to include a private repo as a module. The private repo is on the internal LAN. It supports basic auth but is not publicly available. After importing my private repo, I try go get .
which is equivalent to:
set GOPROXY=myproxy
go get private.repo.net/my/repo
Of course it fails authentication.
What did you expect to see?
There should be a mechanism to disable GOPROXY for certain URLs. For example, HTTP_PROXY has NO_PROXY. Maybe we can have a GO_NOPROXY that works the same way. Then I would expect go get .
to work successfully for both public repos (through the proxy) and private repos (not through the proxy).
What did you see instead?
I saw failed authentication with no way to get around it.
I recognize that authentication is a complex subject, because the GOPROXY would have to forward the client credentials and cache the results on a per-user basis. My thought is that authenticated servers should probably be accessed directly and not through a GOPROXY; hence the need for a GO_NOPROXY environment variable.