{
  "id": "go/panic-in-goroutine-crashes-process",
  "signature": "panic: <custom message> [recovered by no one] — process exits with non-zero status",
  "signature_zh": "panic：<自定义消息> [无人恢复] —— 进程以非零状态退出",
  "regex": "panic:\\ <custom\\ message>\\ \\[recovered\\ by\\ no\\ one\\]\\ —\\ process\\ exits\\ with\\ non\\-zero\\ status",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "An unrecovered panic in any goroutine terminates the entire program. Unlike some languages, Go does not isolate goroutine panics.",
  "root_cause_type": "generic",
  "root_cause_zh": "任何 goroutine 中未恢复的 panic 都会终止整个程序。与其他一些语言不同，Go 不会隔离 goroutine 的 panic。",
  "versions": [
    {
      "version": "1.18",
      "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": "",
      "why_fails": "Sub-goroutine panics still escape and crash the process",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "init runs in the main goroutine; cannot catch other goroutines",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Add 'defer func(){ recover() }()' as the first statement inside every goroutine",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use errgroup and convert panics to errors via a recover wrapper around each task",
      "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-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}