{
  "id": "go/json-cannot-unmarshal-array-into-struct",
  "signature": "json: cannot unmarshal array into Go value of type struct { Name string }",
  "signature_zh": "json: 无法将数组反序列化为结构体类型 struct { Name string }",
  "regex": "json:\\ cannot\\ unmarshal\\ array\\ into\\ Go\\ value\\ of\\ type\\ struct\\ \\{\\ Name\\ string\\ \\}",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "JSON data is an array but target Go type is a struct, causing type mismatch.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 数据是数组，但目标 Go 类型是结构体，导致类型不匹配。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Data not parsed, leads to nil values.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May not match API contract; breaks other code.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Unmarshal into []struct{ Name string } if JSON is array: var data []struct{Name string}; json.Unmarshal([]byte(jsonStr), &data)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use json.RawMessage to inspect first, then unmarshal accordingly.",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}