Modifies `go test -json` output, making it invalid JSON
Closed this issue · 4 comments
dlipovetsky commented
The output of go test -json
contains coverage summaries, e.g.,
{"Time":"2021-06-04T15:08:38.3398169-07:00","Action":"output","Package":"example","Output":"coverage: 14.8% of statements\n"}
These lines are modified by
Line 187 in 65df6ab
Namely, the last part of the split is removed:
{"Time":"2021-06-04T15:08:38.3398169-07:00","Action":"output","Package":"example","Output":"coverage: 14.8
Unfortunately, that is no longer parsable JSON.
aeneasr commented
Would you be up for a PR? :)
dlipovetsky commented
Thanks for triaging this!
The line was introduced to "improve pipeline handling" in ddc3550. I'm honestly not sure what the right fix would be. I don't want to regress pipe handling. Any suggestions? With some direction, I should be able to PR it.
aeneasr commented
One possibility would be to check if the string is JSON and leave it untouched if it isn't json
aeneasr commented
I resolved this issue on master!