go
data_error
ai_generated
true
error: sql: Rows.Next called after Rows.Err
ID: go/database-sql-rows-next-after-error
80%Fix Rate
89%Confidence
0Evidence
2026-10-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.20 | active | — | — | — |
| 1.21 | active | — | — | — |
Root Cause
Calling rows.Next() after an error has occurred during iteration, which is invalid and may panic.
generic中文
在迭代过程中发生错误后调用rows.Next(),这是无效的,可能导致恐慌。
Workarounds
-
98% success Always check rows.Err after the iteration loop
for rows.Next() { /* process */ } if err := rows.Err(); err != nil { return err }
Dead Ends
Common approaches that don't work:
-
Ignoring rows.Err check
90% fail
May miss iteration errors; always check rows.Err after loop.