{
  "id": "go/goroutine-nil-pointer-dereference",
  "signature": "panic: runtime error: invalid memory address or nil pointer dereference (in goroutine)",
  "signature_zh": "panic: 运行时错误: 无效内存地址或 nil 指针解引用（在 goroutine 中）",
  "regex": "panic:\\ runtime\\ error:\\ invalid\\ memory\\ address\\ or\\ nil\\ pointer\\ dereference\\ \\(in\\ goroutine\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A goroutine dereferences a nil pointer, often a struct field or interface that was never initialized, and the panic occurs in a goroutine so the stack trace is asynchronous.",
  "root_cause_type": "generic",
  "root_cause_zh": "一个 goroutine 解引用了 nil 指针，通常是未初始化的结构体字段或接口，且 panic 发生在 goroutine 中，因此堆栈是异步的。",
  "versions": [
    {
      "version": "1.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The nil pointer indicates a logic bug; swallowing it leaves the program in an inconsistent state and loses the stack trace.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Initialize all struct fields in the constructor and validate inputs before spawning goroutines.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.82,
      "how": "Add a recover that logs the stack via debug.Stack() before re-panicking or exiting, so the root cause is visible.",
      "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-03-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}