{
  "id": "go/json-unmarshal-null-into-struct",
  "signature": "error: json: cannot unmarshal null into Go value of type main.User",
  "signature_zh": "错误：无法将 null 反序列化为 main.User 类型的 Go 值",
  "regex": "error:\\ json:\\ cannot\\ unmarshal\\ null\\ into\\ Go\\ value\\ of\\ type\\ main\\.User",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "JSON 数据中的 null 值被尝试反序列化为结构体，但结构体不支持 null。",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 数据中的 null 值被尝试反序列化为结构体，但结构体不支持 null。",
  "versions": [
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "如果该字段是必需的，会导致数据不完整。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "指针可以接受 null，但需要额外处理空值。",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "type User struct { Name *string `json:\"name\"` }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "var raw json.RawMessage\nif err := json.Unmarshal(data, &raw); err != nil { log.Fatal(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-08-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}