errcheck
errcheck copied to clipboard
add flag to allow checking for all unused returns, not just errors
In particular, this would be useful in CockroachDB where we have some structured error types that do not implement the Error interface for various reasons.
cc @kkaneda
+1! https://github.com/kkaneda/returncheck is we have now, and the most of the code is borrowed from errcheck.
Seems like it might be useful in theory, not sure what the UI would look like though
Perhaps we could just take a list of (or file containing) "must use" types, similar to what was done in #116.
+1000
Programmers should at minimum verify the bool multivalue for typecasts, and for hashmap lookups. Glitches there can cause many an unnecessary panic.
I implemented a thing like this: github.com/molecula/noticeme
It's slightly more paranoid than errcheck; for instance, it notices channel receives that aren't used.