Golang Linter for detecting SQL Transaction Begin, Commit and Rollback #6154
-
|
Hi! I’m looking for a Go linter or a golangci-lint plugin that can detect unclosed SQL transactions (e.g., missing Commit() or Rollback()), whether using pgx, libpq, or any other driver. We’re dealing with a large codebase and sometimes run into issues where SQL transaction blocks aren’t properly handled. Has anyone faced a similar problem or found a good tool to catch this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I am not aware of a linter that reliably detects unclosed SQL transactions. But you could try these SQL-related linters in Golangci-lint:
|
Beta Was this translation helpful? Give feedback.
-
|
@adibaulia I recently released my own plugin for Goland and Vscode for unqueryvet — you can try it out now to understand your needs, as the feature will be included by default, so you can monitor your code in RT. If you want to tell me more about the essence of the feature or your needs for it, I will be happy to take it into account during development. Cheers! |
Beta Was this translation helpful? Give feedback.
@adibaulia
Hello, mate!
I am currently developing this feature for unqueryvet, and it should be released in the next minor version, so stay tuned for updates.
I recently released my own plugin for Goland and Vscode for unqueryvet — you can try it out now to understand your needs, as the feature will be included by default, so you can monitor your code in RT.
If you want to tell me more about the essence of the feature or your needs for it, I will be happy to take it into account during development.
Cheers!