rowserrcheck false positive when deferred Close() is wrapped in a func #1774
Labels
dependencies
Relates to an upstream dependency
false positive
An error is reported when one does not exist
rowserrcheck
appears to produce a false positive when a deferredrows.Close()
is wrapped in a func. This is perhaps similar to #1670, but occurs even on versions that should include that fix.The false positive can be reproduced by the following example:
This example will report the following error, despite rows.Err() clearly being checked.
Interestingly, if
defer func() { _ = rows.Close() }()
is changed todefer rows.Close()
, the false positive goes away.Please include the following information:
Version of golangci-lint
Config file
$ cat .golangci.yml
Go environment
The text was updated successfully, but these errors were encountered: