src/cmd/go/pkg.go | 2 +- diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 51567b5afbef9b55638cd9a142586f339bb4c6ad..f949d4e9f22e743aed49ac3bc44714f6324381e4 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -355,7 +355,7 @@ // If no epxansion is found, vendoredImportPath also returns a list of vendor directories // 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)