From: Ian Lance Taylor Date: Thu, 12 Nov 2015 07:13:14 +0000 (-0800) Subject: cmd/go: subdirs of runtime other than runtime/internal do depend on runtime X-Git-Tag: go1.6beta1~511 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d54c35675c1f4d4ca9b5a6de568e977c513f364a;p=gostls13.git cmd/go: subdirs of runtime other than runtime/internal do depend on runtime Correct an error in the last change: it caused runtime/cgo and runtime/race to not depend on runtime. Fixes #13214. Change-Id: Ib48b3b5e9a74567ddfaccb7ab4a897ee2aedc2b8 Reviewed-on: https://go-review.googlesource.com/16837 Reviewed-by: Michael Matloob --- diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index b9218ff9a7..b1b27e4662 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -832,8 +832,9 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package importPaths = append(importPaths, "runtime/cgo") } - // Everything depends on runtime, except runtime, its subpackages, and unsafe. - if !p.Standard || (p.ImportPath != "runtime" && !strings.HasPrefix(p.ImportPath, "runtime/") && p.ImportPath != "unsafe") { + // Everything depends on runtime, except runtime, its internal + // subpackages, and unsafe. + if !p.Standard || (p.ImportPath != "runtime" && !strings.HasPrefix(p.ImportPath, "runtime/internal/") && p.ImportPath != "unsafe") { importPaths = append(importPaths, "runtime") // When race detection enabled everything depends on runtime/race. // Exclude certain packages to avoid circular dependencies.