Skip to content

Commit

Permalink
cmd/go: disable vendoredImportPath for code outside $GOPATH
Browse files Browse the repository at this point in the history
It was crashing.
This fixes the build for
GO15VENDOREXPERIMENT=1 go test -short runtime

Fixes golang#11416.

Change-Id: I74a9114cdd8ebafcc9d2a6f40bf500db19c6e825
Reviewed-on: https://go-review.googlesource.com/11964
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
rsc committed Jul 7, 2015
1 parent 9f90f31 commit b6ead9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/go/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6ead9f

Please sign in to comment.