]> Cypherpunks repositories - gostls13.git/commit
cmd/go: avoid writing non-JSON "build failed" errors from 'go test -json'
authorBryan C. Mills <bcmills@google.com>
Mon, 18 Sep 2023 19:50:27 +0000 (15:50 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 18 Sep 2023 20:29:21 +0000 (20:29 +0000)
commit5b123aeaf5af3044cefeaaeac496443f85344983
treed9ffd5ef649be8e8ed9e7393decdd2a5ef8016b4
parentf4e7675d1150cb683f3d2db7a96084b0d6e26e83
cmd/go: avoid writing non-JSON "build failed" errors from 'go test -json'

In 'go test -json' we expect stdout to contain only JSON events,
not unstructured text. Unstructured text should either go to stderr
or be wrapped in a JSON event.

(If we add structured build output in #62067, we can emit this output
as a build event instead of a test event.)

Fixes #35169.
For #54378.

Change-Id: Ibedd28e79b5adf8d6ae56165b9f0393b14ece9aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/529120
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/test_json_issue35169.txt [new file with mode: 0644]