Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: pass the -x output as a Context key instead of hard-coding os.Stderr #56886

Open
bcmills opened this issue Nov 21, 2022 · 1 comment
Open
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Nov 21, 2022

When we run go build -x, we send a bunch of extra logging to os.Stderr. That's fine in production code, but it makes unit-testing unpleasant: if tests run in parallel with cfg.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 (see cmd/go.maybeStartTrace). We should also use that argument for output streams in order to better isolate tests.

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Nov 21, 2022
@bcmills bcmills added this to the Backlog milestone Nov 21, 2022
@gopherbot
Copy link

gopherbot commented Nov 21, 2022

Change https://go.dev/cl/452456 mentions this issue: cmd/go: propagate Context arguments through modfetch methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants