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/vet: format of -shadow error message needs a patch #14585

Closed
stemar94 opened this issue Mar 1, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@stemar94
Copy link

commented Mar 1, 2016

Currently the output of vet -shadow gives something like the following:

shadowtest.go:17: declaration of local shadows declaration at shadowtest.go:16: 
shadowtest.go:24: declaration of global shadows declaration at shadowtest.go:8: 

Notice the colon space at the end of the line and the fact, that it doesn't get directly clear, which variable is meant.

I would like to propose a format as follows:

shadowtest.go:17: declaration of 'local' shadows declaration at shadowtest.go:16
shadowtest.go:24: declaration of 'global' shadows declaration at shadowtest.go:8

At least the colon space at the end shouldn't be protected by any format guarantee, since I guess it is a bug and isn't especially tested at the moment.
I think the highlighting of the variable name should also be done as long as the -shadow option is still experimental.

I have a CL ready.

@gopherbot

This comment has been minimized.

Copy link

commented Mar 1, 2016

CL https://golang.org/cl/20093 mentions this issue.

@gopherbot gopherbot closed this in a8d4463 Mar 2, 2016

@golang golang locked and limited conversation to collaborators Mar 13, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.