{
  "id": "go/send-on-closed-channel-select",
  "signature": "panic: send on closed channel (inside select statement)",
  "signature_zh": "panic: 向已关闭的 channel 发送数据（在 select 语句中）",
  "regex": "panic:\\ send\\ on\\ closed\\ channel\\ \\(inside\\ select\\ statement\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A select case attempts to send on a channel that has been closed by another goroutine, even though select is often assumed to protect sends.",
  "root_cause_type": "generic",
  "root_cause_zh": "select 的某个 case 尝试向已被其他 goroutine 关闭的 channel 发送数据，尽管通常认为 select 能保护发送操作。",
  "versions": [
    {
      "version": "1.18",
      "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": "default does not prevent the panic when the send case is selected and the channel is closed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Buffering delays but does not prevent the panic; a closed channel rejects all sends regardless of buffer.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "select {\ncase ch <- v:\ncase <-done:\n    return\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "// only the owner closes; producers send via a request channel",
      "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-05-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}