errcheck icon indicating copy to clipboard operation
errcheck copied to clipboard

add flag to allow checking for all unused returns, not just errors

Open tamird opened this issue 9 years ago • 5 comments

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

tamird avatar Feb 25 '16 14:02 tamird

+1! https://github.com/kkaneda/returncheck is we have now, and the most of the code is borrowed from errcheck.

kkaneda avatar Feb 25 '16 14:02 kkaneda

Seems like it might be useful in theory, not sure what the UI would look like though

kisielk avatar Mar 24 '16 17:03 kisielk

Perhaps we could just take a list of (or file containing) "must use" types, similar to what was done in #116.

tamird avatar Nov 18 '16 21:11 tamird

+1000

Programmers should at minimum verify the bool multivalue for typecasts, and for hashmap lookups. Glitches there can cause many an unnecessary panic.

mcandre avatar Jul 09 '19 03:07 mcandre

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.

seebs avatar Sep 28 '20 17:09 seebs