{
  "id": "go/encoding-json-marshal-unsupported-type",
  "signature": "error: json: unsupported type: chan int",
  "signature_zh": "错误：json：不支持的类型：chan int",
  "regex": "error:\\ json:\\ unsupported\\ type:\\ chan\\ int",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Attempting to marshal a Go type that is not supported by encoding/json, such as channels, functions, or complex numbers.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试对 encoding/json 不支持的Go类型进行编组，例如通道、函数或复数。",
  "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": "Using reflect to manually marshal",
      "why_fails": "Complex and error-prone; better to implement json.Marshaler interface.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement json.Marshaler interface for the custom type",
      "success_rate": 0.9,
      "how": "type MyChan chan int\nfunc (c MyChan) MarshalJSON() ([]byte, error) {\n    return json.Marshal(len(c))\n}",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}