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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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 Jan 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment