{
  "id": "go/select-on-nil-channel",
  "signature": "fatal error: all goroutines are asleep - deadlock! (goroutine 1 [select (no cases))])",
  "signature_zh": "致命错误：所有 goroutine 都处于休眠状态 - 死锁！（goroutine 1 [select（无 case）]）",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!\\ \\(goroutine\\ 1\\ \\[select\\ \\(no\\ cases\\)\\)\\]\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A select statement with all nil channels blocks forever because nil channels are never ready.",
  "root_cause_type": "generic",
  "root_cause_zh": "所有通道都是 nil 的 select 语句会永远阻塞，因为 nil 通道永远不会就绪。",
  "versions": [
    {
      "version": "1.19",
      "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 case may execute incorrectly and not handle the intended communication.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Sleeping doesn't resolve the block; the select still blocks.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "ch1 := make(chan int)\nch2 := make(chan int)\nselect {\ncase v := <-ch1:\n    //\ncase v := <-ch2:\n    //\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "select {\ncase v := <-ch:\n    //\ncase <-time.After(time.Second):\n    // timeout\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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}