]> Cypherpunks repositories - gostls13.git/commit
cmd/go: consolidate showOutput, formatOutput, and processOutput into reportCmd
authorAustin Clements <austin@google.com>
Tue, 5 Sep 2023 15:07:29 +0000 (11:07 -0400)
committerAustin Clements <austin@google.com>
Wed, 18 Oct 2023 14:06:30 +0000 (14:06 +0000)
commit5ae9724d905ae3257e072ef7746234e2e3c034e4
tree3abfc188a8dc21e7ed8136974324ff9d13f9f273
parentfb726698b7c0255fa5ef62c042c1387c5ff05049
cmd/go: consolidate showOutput, formatOutput, and processOutput into reportCmd

Many uses of showOutput, formatOutput, and processOutput follow a very
similar (somewhat complex) pattern. Places that diverge from this
pattern are often minor bugs. Furthermore, the roles of formatOutput
and processOutput have somewhat blurred over time; e.g., formatOutput
performs directory shortening, while processOutput performs cgo
demangling.

This CL consolidates all of this logic into a single, new function:
Builder.reportCmd.

In the following CL, we'll replace all calls of the three original
functions with reportCmd.

In addition to being a nice cleanup, this puts us in a much better
position to change how build output is formatted in order to support
`go build -json`.

For #62067.

Change-Id: I733162825377d82d0015c8aae2820e56a1b32958
Reviewed-on: https://go-review.googlesource.com/c/go/+/529218
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/work/exec.go