Pretty sure errcheck will catch that too. The thing that bugs me is the people that make up problems that are not at all problems in real day to day coding.
Re:Everyday hassles in Go
by ominous_prime on Tuesday December 30, 2014 @09:54AM
(#8814792)
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.
FYI the second use is just assignment, that's why it's not caught by the unused variable rule.
Re:Everyday hassles in Go
by ominous_prime on Wednesday December 31, 2014 @10:11PM
(#8822020)
Ah right. It only shadows if it's a new scope.
This compiles:
(I do write Go most days and rather like it, but apologists for its weak parts are legion)