Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: Add a warning when := causes a variable name to be shadowed #5634
The language permits shadowing with := as long as both variables are used after they are defined. However, it would be reasonable for go vet to warn if := is used to define a local variable when there is a local variable of the same name in an enclosing block. Example: http://play.golang.org/p/DQDXOyfwRl . A quick glance might lead one to think this program would print 2, but it prints 0.