I shipped a transaction bug, so I built a linter
A developer encountered a production bug where database operations leaked outside transaction boundaries due to accidentally using the wrong repository reference. To prevent recurrence, they built a custom Go linter using the go/analysis framework that detects when code inside transaction callbacks uses outer repository instances instead of the transaction-scoped parameter. The linter walks the AST, tracks transaction parameters through type objects, recursively analyzes helper functions, and catches violations at compile time. It now runs in CI and has found multiple existing violations across the codebase.