{
  "id": "go/database-sql-rows-closed",
  "signature": "sql: Rows are closed",
  "signature_zh": "sql: 行已关闭",
  "regex": "sql:\\ Rows\\ are\\ closed",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Attempting to call Next() or Scan() on a sql.Rows object after it has been closed, either explicitly or due to an error.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 sql.Rows 对象已关闭后（显式关闭或由于错误）尝试调用 Next() 或 Scan()。",
  "versions": [
    {
      "version": "1.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Rows are already closed; further calls will panic or return stale data.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May cause data inconsistency and resource leaks if not handled properly.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Always check errors and call rows.Close() in defer: defer rows.Close(); for rows.Next() { ... }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check rows.Err() after iteration: if err := rows.Err(); err != nil { handleErr(err) }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}