-
Notifications
You must be signed in to change notification settings - Fork 18k
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: show the version GOROOT corresponds to in go bug
output
#15877
Comments
Sounds good to me. |
Although I'm a bit concerned about breaking people that are parsing the output of 'go env'. Maybe these comments should only be printed with |
We can always print the comment in separate lines so it shouldn't confuse
existing parser that only looks for specific keywords.
|
Can you think of a situation where having a mismatch could be anything but On Tue, 31 May 2016, 19:10 Minux Ma notifications@github.com wrote:
|
Looks like this missed the boat for 1.7. We're cutting the beta today. |
Parsers that expect each line to be a Also, what about something like |
I didn't propose to change the output for "go env VARNAME", only the output
of "go env".
We can limit the extra output lines to cases where there is actually a
version mismatch.
|
Will fix in go bug instead. |
go env
outputgo bug
output
CL https://golang.org/cl/32643 mentions this issue. |
A lot of issue reports are due to incorrect
$GOROOT
setting.For example, I suspect that #15874 is one of them.
I propose that go env also print the version of the tools
the GOROOT corresponds to as a comment.
For example, instead just of printing:
I'd like it also show the version as a comment (so that the output
is still a valid shell script):
For Windows, we probably need to use
REM
on separate lines:For GOROOT, it could use the
go version
command from the directory,for GOTOOLDIR, we can use
compile -V
to get the actual tool version.Because GOTOOLDIR is not settable via environment variables, so
showing the tool version might not be that important, but it will definitely
help when $GOROOT/bin/go is out of sync from the toolchain (this might
help #15372.)
I'd like to add this to Go 1.7 if at all possible.
The text was updated successfully, but these errors were encountered: