]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/work: copy vet tool's stdout to our stdout
authorAlan Donovan <adonovan@google.com>
Thu, 11 Sep 2025 15:02:03 +0000 (11:02 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 12 Sep 2025 21:16:27 +0000 (14:16 -0700)
commitac803b5949f6dbc5bfa559afe506d35f9e1b3195
tree43a7ece5665a0e676ea7f6093a65990d7628e189
parent889e71c2ac43f22dbd41c0b935acac2e778c8f87
cmd/go/internal/work: copy vet tool's stdout to our stdout

The go command connects both the stdout and stderr files of
its child commands (cmd/compile, cmd/vet, etc) to the go
command's own stderr. If the child command is supposed to
produce structure output on stderr, as is the case for
go vet -json or go fix -diff, it will be merged with the
error stream, making it useless.

This change to the go vet <-> unitchecker protocol specifies
the name of a file into which the vet tool should write its
stdout. On success, the go command will then copy the entire
content of that file to its own stdout, under a lock.
This ensures that partial writes to stdout in case of failure,
concurrent writes to stdout by parallel vet tasks, or other
junk on stderr, cannot interfere with the integrity of the
go command's structure output on stdout.

CL 702835 is the corresponding change on the x/tools side.

For #75432

Change-Id: Ib4db25b6b0095d359152d7543bd9bf692551bbfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/702815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/vet_asm.txt