---
title: "unchecked-rows-error"
description: "Detect sql.Rows iteration without an Err check."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# unchecked-rows-error

**Default severity:** `error`

`Rows.Next` returns false both when iteration finishes successfully and when an
iteration error occurs. Check `Rows.Err` after the loop so driver, network, and
decoding failures are not silently treated as successful completion.

## Bad

```go
for rows.Next() { scan(rows) }
```

## Good

```go
for rows.Next() { scan(rows) }; if err := rows.Err(); err != nil { return err }
```

Source: https://strider.gempir.com/analyzers/unchecked-rows-error/index.mdx
