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:
parent
863c9c67a8
commit
6a8dc4ed40
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user