cmd/go: improve error message for missing import starting with cmd/
In modload.Import, confirm that the import path does not start with "cmd/" before calling QueryPackage, which returns a less helpful error. In load.loadPackageData, don't wrap errors with "unknown import path". The wrapped error should always include the import path, and it's also repeated in the PackageError wrapper. Fixes #31031 Change-Id: I071efa22e3842c62831d096f888a8006811fe724 Reviewed-on: https://go-review.googlesource.com/c/go/+/189157 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Showing
Please register or sign in to comment