{
  "id": "go/channel-receive-from-closed",
  "signature": "panic: receive from closed channel (returned zero value)",
  "signature_zh": "恐慌：从已关闭的通道接收（返回零值）",
  "regex": "panic:\\ receive\\ from\\ closed\\ channel\\ \\(returned\\ zero\\ value\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Receiving from a closed channel returns the zero value immediately, which may cause logic errors if not handled.",
  "root_cause_type": "generic",
  "root_cause_zh": "从已关闭的通道接收会立即返回零值，如果处理不当可能导致逻辑错误。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The zero value may be indistinguishable from real data, causing incorrect behavior.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This may skip important data or break the program's flow.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The boolean is only available in the two-value receive form; if not used, it's missed.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use the two-value receive form: v, ok := <-ch; if !ok { /* channel closed */ }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use a done channel to signal closure and avoid receiving from closed channels.",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}