]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix handling of build tags for standard commands
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 9 Oct 2012 15:54:14 +0000 (19:54 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 9 Oct 2012 15:54:14 +0000 (19:54 +0400)
Otherwise if I add '+build !race' to e.g. src/cmd/fix/reflect_test.go,
it does not work.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6642044

src/cmd/go/pkg.go

index e9f344ff91835b768d0468864f7373db031e23fd..307bd74cf171a7c22a288f3d1f763ac371fd8fd1 100644 (file)
@@ -602,7 +602,7 @@ func loadPackage(arg string, stk *importStack) *Package {
                }
                stk.push(arg)
                defer stk.pop()
-               bp, err := build.ImportDir(filepath.Join(gorootSrc, arg), 0)
+               bp, err := buildContext.ImportDir(filepath.Join(gorootSrc, arg), 0)
                bp.ImportPath = arg
                bp.Goroot = true
                bp.BinDir = gorootBin
@@ -630,7 +630,7 @@ func loadPackage(arg string, stk *importStack) *Package {
        // referring to io/ioutil rather than a hypothetical import of
        // "./ioutil".
        if build.IsLocalImport(arg) {
-               bp, _ := build.ImportDir(filepath.Join(cwd, arg), build.FindOnly)
+               bp, _ := buildContext.ImportDir(filepath.Join(cwd, arg), build.FindOnly)
                if bp.ImportPath != "" && bp.ImportPath != "." {
                        arg = bp.ImportPath
                }