]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/load: load imports for all package data errors
authorJay Conrod <jayconrod@google.com>
Tue, 21 Apr 2020 15:29:51 +0000 (11:29 -0400)
committerJay Conrod <jayconrod@google.com>
Tue, 21 Apr 2020 17:11:39 +0000 (17:11 +0000)
commit65f46486a1f27017bc991e132725e8d939d069dd
tree0af71302dce726590a0ccfabd4b0ceba83f2d28b
parent768201729df89a28aae2cc5e41a33ffcb759c113
cmd/go/internal/load: load imports for all package data errors

go/build.Import can return errors for many different reasons like
inconsistent package clauses or errors parsing build constraints.
It will still return a *build.Package with imports from files it was
able to process. Package.load should load these imports, even after an
unknown error.

There is already a special case for scanner.ErrorList (parse
error). This CL expands that behavior for all errors.

Fixes #38568

Change-Id: I871827299c556f1a9a5b12e7755b221e9d8c6e0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/229243
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/testdata/script/list_load_err.txt [new file with mode: 0644]