From d54c35675c1f4d4ca9b5a6de568e977c513f364a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 11 Nov 2015 23:13:14 -0800 Subject: [PATCH] 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 --- src/cmd/go/pkg.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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. -- 2.48.1