diff options
author | Bryan C. Mills <bcmills@google.com> | 2018-11-05 15:01:53 -0500 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2018-11-29 15:42:16 +0000 |
commit | 2012227b01020eb505cf1dbe719b1fa74ed8c5f4 (patch) | |
tree | ed0efe504a2f7e1c716803440572be8452fe329b /src/cmd/go/internal/load/pkg.go | |
parent | 70a684cf44cc3398c44afcd69387d7938d90f063 (diff) | |
download | go-2012227b01020eb505cf1dbe719b1fa74ed8c5f4.tar.gz go-2012227b01020eb505cf1dbe719b1fa74ed8c5f4.zip |
vendor/golang_org/x: move to internal/x
Packages in vendor/ directories have a "vendor/" path prefix in GOPATH
mode, but intentionally do not in module mode. Since the import path
is embedded in the compiled output, changing that path invalidates
cache entries and causes cmd/go to try to rebuild (and reinstall) the
vendored libraries, which will fail if the directory containing those
libraries is read-only.
If I understood correctly, this is the approach Russ suggested as an
alternative to https://golang.org/cl/136138.
Fixes #27285
Fixes #26988
Change-Id: I8a2507fa892b84cde0a803aaa79e460723da572b
Reviewed-on: https://go-review.googlesource.com/c/147443
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/go/internal/load/pkg.go')
-rw-r--r-- | src/cmd/go/internal/load/pkg.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index ae738c6a12..a64bab1479 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1051,20 +1051,6 @@ func disallowVendor(srcDir string, importer *Package, importerPath, path string, return p } - // Modules must not import vendor packages in the standard library, - // but the usual vendor visibility check will not catch them - // because the module loader presents them with an ImportPath starting - // with "golang_org/" instead of "vendor/". - if p.Standard && !importer.Standard && strings.HasPrefix(p.ImportPath, "golang_org") { - perr := *p - perr.Error = &PackageError{ - ImportStack: stk.Copy(), - Err: "use of vendored package " + path + " not allowed", - } - perr.Incomplete = true - return &perr - } - if perr := disallowVendorVisibility(srcDir, p, stk); perr != p { return perr } |