2 ms·
The 'go vet' command has a -shadow flag to check for this. And as the author points out, editors can point it out as well. It definitely isn't ideal, but it ca
by kyrra 11y ago
The 'go vet' command has a -shadow flag to check for this. And as the author points out, editors can point it out as well.
It definitely isn't ideal, but it can be dealt with. I believe Rob Pike had called out that the number of ways you can do variable assignment/declaration is something he disliked, but it's impossible to change in Go 1 at this point.