]> Cypherpunks repositories - gostls13.git/commit
cmd/go: return and handle errors from loadImport for bad imports
authorMichael Matloob <matloob@golang.org>
Mon, 3 Apr 2023 20:07:41 +0000 (16:07 -0400)
committerMichael Matloob <matloob@golang.org>
Mon, 10 Apr 2023 20:27:52 +0000 (20:27 +0000)
commita5c79283f79b5f03296fc2037f32d935aaec806f
tree474a12fd524f7f6f0257f1e2cbd81e78c515e8a2
parentdf6396fc22823e9ab666d2d06c86f219d5129926
cmd/go: return and handle errors from loadImport for bad imports

And assign the error to the importing package. Before this change, for
some errors for bad imports, such as importing a vendored package with
the wrong path, we would make a dummy package for the imported package
with the error on it. Instead report the error on the importing
package where it belongs. Do so by returning an error from loadImport
and handling it on the importing package.

For #59157

Change-Id: I952e1a82af3857efc5da4fd3f8bc6be473a60cf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/482877
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/get/get.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/internal/work/action.go
src/cmd/go/testdata/script/list_import_err.txt [new file with mode: 0644]