]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add GOPRIVATE environment variable
authorRuss Cox <rsc@golang.org>
Tue, 11 Jun 2019 17:53:12 +0000 (13:53 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 12 Jun 2019 18:49:43 +0000 (18:49 +0000)
commit82cf8bca9cf20297bc0edf481cc530c9b3f4bf1e
tree35c7cc89f93fa94e0bb1f9db680671f49afb79bb
parentf44404ebbfeff57f3e45ebf4b314a320bb89841f
cmd/go: add GOPRIVATE environment variable

It is too confusing to have to set GONOSUMDB and GONOPROXY
in common use cases, but one cannot be guaranteed to be a
subset of the other.

This CL adds GOPRIVATE, which takes the same kind of pattern list
but is defined as "these patterns are private (non-public) modules".
Today the implication is that GOPRIVATE is the default setting for
GONOSUMDB and GONOPROXY. If there are other accommodations
to make for private packages in the future or in other tools,
having this clear statement of intent will let us do that.
(For example maybe an IDE integration would hyperlink an import
path to godoc.org; consulting GOPRIVATE would be a reasonable
way to decide not to do that for certain imports. In contrast,
consulting GONOPROXY or GONOSUMDB clearly would not.)

Fixes #32184.

Change-Id: If54c12d353c7a0a5c0e0273764140cce3c154a02
Reviewed-on: https://go-review.googlesource.com/c/go/+/181719
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/alldocs.go
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/envcmd/env.go
src/cmd/go/internal/help/helpdoc.go
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/modload/help.go
src/cmd/go/main.go
src/cmd/go/script_test.go
src/cmd/go/testdata/script/mod_gonoproxy.txt