{
  "id": "go/json-unmarshal-type-mismatch",
  "signature": "json: cannot unmarshal number into Go value of type string",
  "signature_zh": "json: 无法将数字反序列化为字符串类型的 Go 值",
  "regex": "json:\\ cannot\\ unmarshal\\ number\\ into\\ Go\\ value\\ of\\ type\\ string",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "The JSON data contains a value of a different type than the target Go field, such as a number where a string is expected.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 数据包含与目标 Go 字段类型不同的值，例如在期望字符串的地方出现了数字。",
  "versions": [
    {
      "version": "1.14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This only works if the field is of type json.Number, not string.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Tags do not change the type conversion.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Define the struct field as interface{} and then type assert.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use a custom UnmarshalJSON method to handle type conversion.",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}