{
  "id": "go/sql-scan-into-nil-pointer",
  "signature": "sql: Scan error on column index 0: converting NULL to string is unsupported",
  "signature_zh": "sql: 扫描第 0 列错误：不支持将 NULL 转换为 string",
  "regex": "sql:\\ Scan\\ error\\ on\\ column\\ index\\ 0:\\ converting\\ NULL\\ to\\ string\\ is\\ unsupported",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Database returned NULL for a column scanned into a non-nullable Go type.",
  "root_cause_type": "generic",
  "root_cause_zh": "数据库为某个列返回 NULL，但扫描到了不可为空的 Go 类型。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "May cause incorrect logic; NULL vs empty differ.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May not be possible; data already has NULLs.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use sql.NullString: var ns sql.NullString; rows.Scan(&ns); if ns.Valid { use ns.String }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use pointers: var s *string; rows.Scan(&s); if s != nil { use *s }",
      "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": "2025-03-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}