From 2012227b01020eb505cf1dbe719b1fa74ed8c5f4 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 5 Nov 2018 15:01:53 -0500 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/api/goapi.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/cmd/api') diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index 9698f25b51..02dfa7c841 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -442,13 +442,8 @@ func (w *Walker) Import(name string) (*types.Package, error) { } w.imported[name] = &importing - root := w.root - if strings.HasPrefix(name, "golang_org/x/") { - root = filepath.Join(root, "vendor") - } - // Determine package files. - dir := filepath.Join(root, filepath.FromSlash(name)) + dir := filepath.Join(w.root, filepath.FromSlash(name)) if fi, err := os.Stat(dir); err != nil || !fi.IsDir() { log.Fatalf("no source in tree for import %q: %v", name, err) } -- cgit v1.3