Commit b6ead9f1 authored by Russ Cox's avatar Russ Cox

cmd/go: disable vendoredImportPath for code outside $GOPATH

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/11964Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent 9f90f31c
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment