1
0
mirror of https://github.com/golang/go synced 2024-11-18 19:54:44 -07:00

oracle: report a better error if query is outside GOROOT/GOPATH

Change-Id: I2f724b5015021be8bf1fccb518f17cc011d687e8
Reviewed-on: https://go-review.googlesource.com/9546
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Alan Donovan 2015-04-30 13:29:28 -04:00
parent 863c9c67a8
commit 6a8dc4ed40

View File

@ -152,7 +152,8 @@ func guessImportPath(filename string, buildContext *build.Context) (srcdir, impo
}
}
if srcdir == "" {
err = fmt.Errorf("can't find package for file %s", filename)
err = fmt.Errorf("directory %s is not beneath GOROOT or GOPATH: %s",
filepath.Dir(absFile), strings.Join(buildContext.SrcDirs(), ", "))
}
return
}