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

go: prints module lookup information into error stream #29848

Closed
raydac opened this issue Jan 21, 2019 · 3 comments
Closed

go: prints module lookup information into error stream #29848

raydac opened this issue Jan 21, 2019 · 3 comments

Comments

@raydac
Copy link

raydac commented Jan 21, 2019

What version of Go are you using (go version)?

go version go1.11.1 linux/amd64

Does this issue reproduce with the latest release?

yes

What did you expect to see?

go prints messages about module lookup into stdout because it is not an error

What did you see instead?

go prints messages about module lookup into stderr
cache.go contains such code

if !QuietLookup {
			fmt.Fprintf(os.Stderr, "go: finding %s %s\n", r.path, rev)
		}
if !QuietLookup {
			fmt.Fprintf(os.Stderr, "go: finding %s latest\n", r.path)
		}
@raydac raydac changed the title go: prints information into error stream go: prints module lookup information into error stream Jan 21, 2019
@mvdan
Copy link
Member

mvdan commented Jan 21, 2019

It's very common for log messages to go to stderr. In fact, if they went to stdout, they would get mixed with a command's normal output, which the user might need to read and use.

Imagine go list some.package/path/.... If that command has to download a module, the standard output would be more than just the resulting package paths.

So I'm not sure how you'd send all log messages to stdout without breaking cmd/go in a dozen ways.

@mvdan
Copy link
Member

mvdan commented Jan 21, 2019

To further prove my point, see how the log package defaults to os.Stderr: https://golang.org/src/log/log.go?s=#L73

@raydac
Copy link
Author

raydac commented Jan 21, 2019

ok, as I see it is some feature, not a bug, so I will find workaround in my tool, thanks

@raydac raydac closed this as completed Jan 21, 2019
@golang golang locked and limited conversation to collaborators Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants