{
  "id": "go/race-detector-detected",
  "signature": "WARNING: DATA RACE\nWrite at 0x... by goroutine 7:\n  main.main.func1()\n      /main.go:12 +0x...\nPrevious read at 0x... by main goroutine:\n  main.main()\n      /main.go:9 +0x...",
  "signature_zh": "警告：数据竞争\n写操作 0x... 由 goroutine 7 执行：\n  main.main.func1()\n      /main.go:12 +0x...\n之前读操作 0x... 由主 goroutine 执行：\n  main.main()\n      /main.go:9 +0x...",
  "regex": "WARNING:\\ DATA\\ RACE\\\nWrite\\ at\\ 0x\\.\\.\\.\\ by\\ goroutine\\ 7:\\\n\\ \\ main\\.main\\.func1\\(\\)\\\n\\ \\ \\ \\ \\ \\ /main\\.go:12\\ \\+0x\\.\\.\\.\\\nPrevious\\ read\\ at\\ 0x\\.\\.\\.\\ by\\ main\\ goroutine:\\\n\\ \\ main\\.main\\(\\)\\\n\\ \\ \\ \\ \\ \\ /main\\.go:9\\ \\+0x\\.\\.\\.",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The race detector (-race) found unsynchronized access to shared memory between goroutines.",
  "root_cause_type": "generic",
  "root_cause_zh": "race 检测器（-race）发现 goroutine 之间对共享内存的未同步访问。",
  "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": "Hides the bug; production will still corrupt data.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Reduces but does not eliminate race; detector still flags it.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "var mu sync.Mutex\nmu.Lock()\ncounter++\nmu.Unlock()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "results := make(chan int, 1)\ngo func() { results <- compute() }()\nv := <-results",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}