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: go list -e -export -json -gcflags=-bogus math prints to stderr #46817

Closed
mdempsky opened this issue Jun 18, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

https://tip.golang.org/cmd/go/#hdr-List_packages_or_modules says:

The -e flag changes the handling of erroneous packages, those that cannot be found or are malformed. By default, the list command prints an error to standard error for each erroneous package and omits the packages from consideration during the usual printing. With the -e flag, the list command never prints errors to standard error and instead processes the erroneous packages with the usual printing. Erroneous packages will have a non-empty ImportPath and a non-nil Error field; other information may or may not be missing (zeroed).

However, at least some compiler errors still end up getting written to stderr. For example, go list -e -export -json -gcflags=-bogus math >/dev/null shows output for me.

/cc @rsc @bcmills @jayconrod

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 18, 2021
@bcmills bcmills added this to the Backlog milestone Jun 18, 2021
@wymli
Copy link

wymli commented Jul 22, 2021

go get prints to stderr too.
It's kind of strange.
For example, I have to use update_msg=$(go get -u ${some_pkg} 2>&1) to capture the output.

@dominikh
Copy link
Member

Other instances of output on stderr:

#51180
#50869
#25842

@bcmills
Copy link
Contributor

bcmills commented Sep 30, 2022

Duplicate of #25842

@bcmills bcmills marked this as a duplicate of #25842 Sep 30, 2022
@bcmills bcmills closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
@golang golang locked and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants