We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 tool vet -shadow . didn't report anything for example code below. Tested both go 1.5.3 and 1.6.
go tool vet -shadow .
package main import "fmt" func main() { ch1 := make(chan int) ch2 := make(chan int) go func() { ch1 <- 1 ch2 <- 2 }() var result int for i := 0; i < 2; i++ { select { case result = <-ch1: fmt.Println(result) case result := <-ch2: // <-- shadowing fmt.Println(result) } } fmt.Println(result) // expect 2, got 1 }
The text was updated successfully, but these errors were encountered:
This works with tip:
go tool vet -shadow 1.go 1.go:17: declaration of "result" shadows declaration at 1.go:12
Sorry, something went wrong.
Wow that is great! I just didn't find relevant issues before creating this one.
No branches or pull requests
go tool vet -shadow .
didn't report anything for example code below. Tested both go 1.5.3 and 1.6.The text was updated successfully, but these errors were encountered: