]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: disable vendoredImportPath for code outside $GOPATH go1.5beta1
authorRuss Cox <rsc@golang.org>
Tue, 7 Jul 2015 21:51:20 +0000 (17:51 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 7 Jul 2015 21:53:11 +0000 (21:53 +0000)
It was crashing.
This fixes the build for
GO15VENDOREXPERIMENT=1 go test -short runtime

Fixes #11416.

Change-Id: I74a9114cdd8ebafcc9d2a6f40bf500db19c6e825
Reviewed-on: https://go-review.googlesource.com/11964
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/pkg.go

index 51567b5afbef9b55638cd9a142586f339bb4c6ad..f949d4e9f22e743aed49ac3bc44714f6324381e4 100644 (file)
@@ -355,7 +355,7 @@ func isDir(path string) bool {
 // it searched along the way, to help prepare a useful error message should path turn
 // out not to exist.
 func vendoredImportPath(parent *Package, path string) (found string, searched []string) {
-       if parent == nil || !go15VendorExperiment {
+       if parent == nil || parent.Root == "" || !go15VendorExperiment {
                return path, nil
        }
        dir := filepath.Clean(parent.Dir)