From 6a8dc4ed40822ce940caba73e78d0b7a4ea99fa8 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Thu, 30 Apr 2015 13:29:28 -0400 Subject: [PATCH] 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 --- oracle/what.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oracle/what.go b/oracle/what.go index ca1a7fff2d6..b4d70aad2c7 100644 --- a/oracle/what.go +++ b/oracle/what.go @@ -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 }