cmd/go: pass the -x
output as a Context
key instead of hard-coding os.Stderr
#56886
Milestone
-x
output as a Context
key instead of hard-coding os.Stderr
#56886
When we run
go build -x
, we send a bunch of extra logging toos.Stderr
. That's fine in production code, but it makes unit-testing unpleasant: if tests run in parallel withcfg.BuildX
set to true, the logging from the tests ends up all jumbled together.We're already threading through a
context.Context
argument to many functions for tracing (seecmd/go.maybeStartTrace
). We should also use that argument for output streams in order to better isolate tests.The text was updated successfully, but these errors were encountered: