3 ms·
This looks more like a bug. The second err is a valid redeclaration, and so should be checked for usage on it's own. Though the redeclaration through multiple a
by ominous_prime 12y ago
This looks more like a bug. The second err is a valid redeclaration, and so should be checked for usage on it's own. Though the redeclaration through multiple assignment is itself a bit of a wart that the programmer hast to be wary of, so it may not be a big deal.
In any case, the go compiler is very helpful in most cases, and better tooling can improve things further.
- NateDad 12y agoFYI the second use is just assignment, that's why it's not caught by the unused variable rule.
- ominous_prime 12y agoAh right. It only shadows if it's a new scope.