{
  "id": "go/sql-converting-null-to-string",
  "signature": "sql: Scan error on column index 2, name \"email\": converting NULL to string is unsupported",
  "signature_zh": "sql：Scan 错误，列索引 2 名称 \"email\"：不支持将 NULL 转换为 string",
  "regex": "sql:\\ Scan\\ error\\ on\\ column\\ index\\ 2,\\ name\\ \"email\":\\ converting\\ NULL\\ to\\ string\\ is\\ unsupported",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A nullable column was scanned into a non-pointer string. NULL cannot be assigned to string.",
  "root_cause_type": "generic",
  "root_cause_zh": "向非指针 string 扫描可空列。NULL 无法赋给 string。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Loses the distinction between empty and NULL.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Requires type assertion and is error-prone.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "var email sql.NullString\nerr := row.Scan(&email)\nif email.Valid { u.Email = email.String }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Use a pointer *string for nullable columns.",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-04",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}