{
  "id": "go/goroutine-channel-close-race",
  "signature": "panic: close of closed channel (in goroutine)",
  "signature_zh": "恐慌：关闭已关闭的通道（在 goroutine 中）",
  "regex": "panic:\\ close\\ of\\ closed\\ channel\\ \\(in\\ goroutine\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Two or more goroutines attempt to close the same channel without synchronization, causing a panic.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个或多个 goroutine 在没有同步的情况下尝试关闭同一个通道，导致恐慌。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Recovering doesn't solve the race; it masks the error but may leave other goroutines in inconsistent state.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Flag check is racy; another goroutine may close it between check and close.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use sync.Once to ensure channel is closed only once.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Designate a single goroutine to own the channel and close it.",
      "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-12-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}