Apologies for replying to an old post.
But I am sometimes a bit slow in reading my messages.

I too think that errcheck's is a bit severe in its treatment of deferred 
calls to Close().

So I forked the code and changed the behaviour to be more permissive.
https://github.com/amnonbc/errcheck

Feel free to use it.

- amnon

On Wednesday, 16 August 2017 13:05:39 UTC+1, Gert wrote:
>
> To pass errcheck I need to do something like
>
> defer func() { _ = resp.Body.Close() }()
>
> instead of 
>
> defer resp.Body.Close()
>
> Is this something the errcheck tool can figure out to mark as valid 
> instead or does the errcheck tool need help from the compiler so the second 
> case is also ok?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0bcd5c8f-6b9a-4690-80c4-5cb5f71d3427o%40googlegroups.com.

Reply via email to