]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: subdirs of runtime other than runtime/internal do depend on runtime
authorIan Lance Taylor <iant@golang.org>
Thu, 12 Nov 2015 07:13:14 +0000 (23:13 -0800)
committerMichael Matloob <matloob@golang.org>
Thu, 12 Nov 2015 15:35:48 +0000 (15:35 +0000)
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 <matloob@golang.org>
src/cmd/go/pkg.go

index b9218ff9a73d1ad2dde0c3867be848b3e60613bd..b1b27e4662da9e5f30c55ffd33f33ea56f360dc3 100644 (file)
@@ -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.