Skip to content

Commit b6ead9f

Browse files
committed
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/11964 Reviewed-by: Russ Cox <[email protected]>
1 parent 9f90f31 commit b6ead9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/pkg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func isDir(path string) bool {
355355
// it searched along the way, to help prepare a useful error message should path turn
356356
// out not to exist.
357357
func vendoredImportPath(parent *Package, path string) (found string, searched []string) {
358-
if parent == nil || !go15VendorExperiment {
358+
if parent == nil || parent.Root == "" || !go15VendorExperiment {
359359
return path, nil
360360
}
361361
dir := filepath.Clean(parent.Dir)

0 commit comments

Comments
 (0)