travis: Enforce no variable shadowing
maruel opened this issue · 1 comments
maruel commented
In travis, the following should be run:
go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
go vet -vettool=$(which shadow) ./...
This would have caught problems like issue #412. This bug was filed because the code is unreachable, but it would have caught due to the variable shadowing too.
In practice most of these are innocuous err shadowing so fixing these is a waste of time. But I think it's worth catching bugs like 412 so the benefit outweighs the pain.