{
  "id": "go/goroutine-nil-pointer-in-goroutine",
  "signature": "panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x...] (in goroutine N)",
  "signature_zh": "panic: runtime error: 无效内存地址或 nil 指针解引用 [signal SIGSEGV...]（位于 goroutine N）",
  "regex": "panic:\\ runtime\\ error:\\ invalid\\ memory\\ address\\ or\\ nil\\ pointer\\ dereference\\ \\[signal\\ SIGSEGV:\\ segmentation\\ violation\\ code=0x1\\ addr=0x0\\ pc=0x\\.\\.\\.\\]\\ \\(in\\ goroutine\\ N\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A goroutine dereferences a nil pointer, often because it captured a variable that was not yet assigned or a struct field was left uninitialized.",
  "root_cause_type": "generic",
  "root_cause_zh": "goroutine 解引用了 nil 指针，通常是因为它捕获了尚未赋值的变量，或结构体字段未初始化。",
  "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"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the nil is a logic error (e.g., missing initialization), skipping the work silently hides the bug.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Recovering prevents a crash but does not fix the root cause; the same nil deref will recur.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "for _, item := range items {\n    item := item\n    go func(it *Item) {\n        process(it)\n    }(&item)\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "svc := &Service{Client: newClient()}\ngo svc.Run()",
      "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-02-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}