sqlclosecheck icon indicating copy to clipboard operation
sqlclosecheck copied to clipboard

Check Row.Scan calls

Open Lumaraf opened this issue 4 years ago • 1 comments

The sql.Row structs returned by the QueryRow methods contain a reference to a sql.Rows instance that is only closed when Scan is called. (see https://cs.opensource.google/go/go/+/refs/tags/go1.17.3:src/database/sql/sql.go;l=3326) Thus i think that this linter should also look for missing Row.Scan calls which would cause the same problems as missing Rows.Close calls.

Lumaraf avatar Nov 18 '21 16:11 Lumaraf

Thank you for raising this. I'm adding this to the list of improvements to make.

ryanrolds avatar Aug 20 '23 19:08 ryanrolds