> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# go-sql-rows-leaked

> A Go database/sql Rows iterator exits successfully before exhaustion without closing.

## What it flags

A locally owned Go `database/sql` iterator whose loop returns before all rows are read. The rule targets a direct success return with no visible Close first.

## How to review or fix

Check the query error, then defer `rows.Close()` so early returns also release the iterator.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.