]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add Printer interface and use for error reporting
authorAustin Clements <austin@google.com>
Tue, 17 Oct 2023 20:30:36 +0000 (16:30 -0400)
committerAustin Clements <austin@google.com>
Sun, 17 Nov 2024 14:31:53 +0000 (14:31 +0000)
commit47da5a303f642c7c863e0fe9a5554fb85dd45d68
treee82802d7830ed491df10b16c60b8704b4c380f9a
parent5ebb4e282e72ac14d20a845601921739a072e953
cmd/go: add Printer interface and use for error reporting

This replaces the existing Shell print function callback. The
interface also gives us a way to report build failures, which is the
other type of event that will appear in the build -json output.

This CL hooks up error reporting in two places:

- In Builder.Do, where all builder errors are reported.

- In load.CheckPackageErrors, where most loading errors are reported.

For #62067.

Change-Id: Id66a31b0d2c3786559c7d2bb376fffeffc9a66ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/536396
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/clean/clean.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/printer.go [new file with mode: 0644]
src/cmd/go/internal/work/build_test.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/shell.go