mirror of
https://github.com/golang/go
synced 2024-11-23 22:00:11 -07:00
cmd/go: enable vendoring experiment by default
If we're going to do this for Go 1.6 we might as well do it now and find out what breaks. Change-Id: I8306b7829d8d13b564a1466c902ec6ba1a5a58c1 Reviewed-on: https://go-review.googlesource.com/13967 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
35365b97f1
commit
a82ed3bc81
@ -484,8 +484,8 @@ rule is that if the local installation is running version "go1", get
|
|||||||
searches for a branch or tag named "go1". If no such version exists it
|
searches for a branch or tag named "go1". If no such version exists it
|
||||||
retrieves the most recent version of the package.
|
retrieves the most recent version of the package.
|
||||||
|
|
||||||
If the vendoring experiment is enabled (see 'go help gopath'),
|
Unless vendoring support is disabled (see 'go help gopath'),
|
||||||
then when go get checks out or updates a Git repository,
|
when go get checks out or updates a Git repository,
|
||||||
it also updates any git submodules referenced by the repository.
|
it also updates any git submodules referenced by the repository.
|
||||||
|
|
||||||
For more about specifying packages, see 'go help packages'.
|
For more about specifying packages, see 'go help packages'.
|
||||||
@ -934,13 +934,10 @@ See https://golang.org/s/go14internal for details.
|
|||||||
|
|
||||||
Vendor Directories
|
Vendor Directories
|
||||||
|
|
||||||
Go 1.5 includes experimental support for using local copies
|
Go 1.6 includes support for using local copies of external dependencies
|
||||||
of external dependencies to satisfy imports of those dependencies,
|
to satisfy imports of those dependencies, often referred to as vendoring.
|
||||||
often referred to as vendoring. Setting the environment variable
|
|
||||||
GO15VENDOREXPERIMENT=1 enables that experimental support.
|
|
||||||
|
|
||||||
When the vendor experiment is enabled,
|
Code below a directory named "vendor" is importable only
|
||||||
code below a directory named "vendor" is importable only
|
|
||||||
by code in the directory tree rooted at the parent of "vendor",
|
by code in the directory tree rooted at the parent of "vendor",
|
||||||
and only using an import path that omits the prefix up to and
|
and only using an import path that omits the prefix up to and
|
||||||
including the vendor element.
|
including the vendor element.
|
||||||
@ -978,9 +975,18 @@ top-level "crash/bang".
|
|||||||
Code in vendor directories is not subject to import path
|
Code in vendor directories is not subject to import path
|
||||||
checking (see 'go help importpath').
|
checking (see 'go help importpath').
|
||||||
|
|
||||||
When the vendor experiment is enabled, 'go get' checks out
|
When 'go get' checks out or updates a git repository, it now also
|
||||||
submodules when checking out or updating a git repository
|
updates submodules.
|
||||||
(see 'go help get').
|
|
||||||
|
Vendor directories do not affect the placement of new repositories
|
||||||
|
being checked out for the first time by 'go get': those are always
|
||||||
|
placed in the main GOPATH, never in a vendor subtree.
|
||||||
|
|
||||||
|
In Go 1.5, as an experiment, setting the environment variable
|
||||||
|
GO15VENDOREXPERIMENT=1 enabled these features.
|
||||||
|
As of Go 1.6 they are on by default. To turn them off, set
|
||||||
|
GO15VENDOREXPERIMENT=0. In Go 1.7, the environment
|
||||||
|
variable will stop having any effect.
|
||||||
|
|
||||||
The vendoring semantics are an experiment, and they may change
|
The vendoring semantics are an experiment, and they may change
|
||||||
in future releases. Once settled, they will be on by default.
|
in future releases. Once settled, they will be on by default.
|
||||||
|
@ -51,8 +51,8 @@ rule is that if the local installation is running version "go1", get
|
|||||||
searches for a branch or tag named "go1". If no such version exists it
|
searches for a branch or tag named "go1". If no such version exists it
|
||||||
retrieves the most recent version of the package.
|
retrieves the most recent version of the package.
|
||||||
|
|
||||||
If the vendoring experiment is enabled (see 'go help gopath'),
|
Unless vendoring support is disabled (see 'go help gopath'),
|
||||||
then when go get checks out or updates a Git repository,
|
when go get checks out or updates a Git repository,
|
||||||
it also updates any git submodules referenced by the repository.
|
it also updates any git submodules referenced by the repository.
|
||||||
|
|
||||||
For more about specifying packages, see 'go help packages'.
|
For more about specifying packages, see 'go help packages'.
|
||||||
|
@ -365,13 +365,10 @@ See https://golang.org/s/go14internal for details.
|
|||||||
|
|
||||||
Vendor Directories
|
Vendor Directories
|
||||||
|
|
||||||
Go 1.5 includes experimental support for using local copies
|
Go 1.6 includes support for using local copies of external dependencies
|
||||||
of external dependencies to satisfy imports of those dependencies,
|
to satisfy imports of those dependencies, often referred to as vendoring.
|
||||||
often referred to as vendoring. Setting the environment variable
|
|
||||||
GO15VENDOREXPERIMENT=1 enables that experimental support.
|
|
||||||
|
|
||||||
When the vendor experiment is enabled,
|
Code below a directory named "vendor" is importable only
|
||||||
code below a directory named "vendor" is importable only
|
|
||||||
by code in the directory tree rooted at the parent of "vendor",
|
by code in the directory tree rooted at the parent of "vendor",
|
||||||
and only using an import path that omits the prefix up to and
|
and only using an import path that omits the prefix up to and
|
||||||
including the vendor element.
|
including the vendor element.
|
||||||
@ -409,9 +406,18 @@ top-level "crash/bang".
|
|||||||
Code in vendor directories is not subject to import path
|
Code in vendor directories is not subject to import path
|
||||||
checking (see 'go help importpath').
|
checking (see 'go help importpath').
|
||||||
|
|
||||||
When the vendor experiment is enabled, 'go get' checks out
|
When 'go get' checks out or updates a git repository, it now also
|
||||||
submodules when checking out or updating a git repository
|
updates submodules.
|
||||||
(see 'go help get').
|
|
||||||
|
Vendor directories do not affect the placement of new repositories
|
||||||
|
being checked out for the first time by 'go get': those are always
|
||||||
|
placed in the main GOPATH, never in a vendor subtree.
|
||||||
|
|
||||||
|
In Go 1.5, as an experiment, setting the environment variable
|
||||||
|
GO15VENDOREXPERIMENT=1 enabled these features.
|
||||||
|
As of Go 1.6 they are on by default. To turn them off, set
|
||||||
|
GO15VENDOREXPERIMENT=0. In Go 1.7, the environment
|
||||||
|
variable will stop having any effect.
|
||||||
|
|
||||||
The vendoring semantics are an experiment, and they may change
|
The vendoring semantics are an experiment, and they may change
|
||||||
in future releases. Once settled, they will be on by default.
|
in future releases. Once settled, they will be on by default.
|
||||||
|
@ -250,11 +250,13 @@ func reloadPackage(arg string, stk *importStack) *Package {
|
|||||||
return loadPackage(arg, stk)
|
return loadPackage(arg, stk)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Go 1.5 vendoring experiment is enabled by setting GO15VENDOREXPERIMENT=1.
|
// The Go 1.5 vendoring experiment was enabled by setting GO15VENDOREXPERIMENT=1.
|
||||||
|
// In Go 1.6 this is on by default and is disabled by setting GO15VENDOREXPERIMENT=0.
|
||||||
|
// In Go 1.7 the variable will stop having any effect.
|
||||||
// The variable is obnoxiously long so that years from now when people find it in
|
// The variable is obnoxiously long so that years from now when people find it in
|
||||||
// their profiles and wonder what it does, there is some chance that a web search
|
// their profiles and wonder what it does, there is some chance that a web search
|
||||||
// might answer the question.
|
// might answer the question.
|
||||||
var go15VendorExperiment = os.Getenv("GO15VENDOREXPERIMENT") == "1"
|
var go15VendorExperiment = os.Getenv("GO15VENDOREXPERIMENT") != "0"
|
||||||
|
|
||||||
// dirToImportPath returns the pseudo-import path we use for a package
|
// dirToImportPath returns the pseudo-import path we use for a package
|
||||||
// outside the Go path. It begins with _/ and then contains the full path
|
// outside the Go path. It begins with _/ and then contains the full path
|
||||||
|
Loading…
Reference in New Issue
Block a user