{
  "id": "go/json-marshal-unsupported-type",
  "signature": "error: json: unsupported type: chan int",
  "signature_zh": "错误：JSON 不支持的类型：通道 int",
  "regex": "error:\\ json:\\ unsupported\\ type:\\ chan\\ int",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "尝试将 Go 中不支持 JSON 序列化的类型（如 channel、complex、func）传递给 json.Marshal。",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试将 Go 中不支持 JSON 序列化的类型（如 channel、complex、func）传递给 json.Marshal。",
  "versions": [
    {
      "version": "1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "会丢失类型信息，且无法还原为原始数据。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "如果该字段是必须的，忽略会导致数据不完整。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "func (c MyChan) MarshalJSON() ([]byte, error) { return json.Marshal(c.String()) }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "type MyStruct struct { Data []int `json:\"data\"` }",
      "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-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}