{
  "id": "go/encoding-json-unmarshal-unknown-field",
  "signature": "error: json: cannot unmarshal object into Go value of type struct { Name string `json:\"name\"` }",
  "signature_zh": "错误：json：无法将对象反序列化为Go结构体类型 { Name string `json:\"name\"` }",
  "regex": "error:\\ json:\\ cannot\\ unmarshal\\ object\\ into\\ Go\\ value\\ of\\ type\\ struct\\ \\{\\ Name\\ string\\ `json:\"name\"`\\ \\}",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "JSON数据包含结构体中未定义的字段，默认情况下encoding/json会忽略未知字段，但若结构体定义不匹配则报错。",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON数据包含结构体中未定义的字段，encoding/json默认忽略未知字段，但若结构体定义不匹配则报错。",
  "versions": [
    {
      "version": "1.20",
      "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": "不灵活，且当API变化时维护困难。",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "失去类型安全，需要手动类型断言，容易出错。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "type MyStruct struct {\n    Name string `json:\"name\"`\n    Extra json.RawMessage `json:\"-\"`\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "使用json.Decoder.DisallowUnknownFields()来捕获未知字段错误。",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}