Skip to content

added "defer rows.Close()" after error handling of db.Query

Karol Bunkowski requested to merge sql-exporter_fix_kb1 into master

"defer rows.Close()" should be added according to this article https://www.calhoun.io/querying-for-multiple-records-with-gos-sql-package/

Hopefully, it will allow to avoid

ERROR: statement 0xc00108be40 of prepareContext is not closed!

that we started observing on 20 April 2024

Merge request reports