ryanrolds / sqlclosecheck

Linter that confirms DB rows and statements are closed properly.
MIT License
80 stars 14 forks source link

Statements prepared in transaction do not need to be closed #14

Open bunyk opened 2 years ago

bunyk commented 2 years ago

Because, quoting documentation, "The statements prepared for a transaction by calling the transaction's Prepare or Stmt methods are closed by the call to Commit or Rollback.". https://pkg.go.dev/database/sql#Tx

Linter should avoid printing warnings about this.

ryanrolds commented 10 months ago

I'm sorry for not getting back to you sooner. Please provide a test case (example), and I will look into it.