{
  "id": "go/http-multiple-registrations",
  "signature": "http: multiple registrations for /api/v1/users",
  "signature_zh": "http: /api/v1/users 的重复注册",
  "regex": "http:\\ multiple\\ registrations\\ for\\ /api/v1/users",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The same URL pattern is registered multiple times with http.Handle or http.HandleFunc, causing a panic.",
  "root_cause_type": "generic",
  "root_cause_zh": "相同的 URL 模式多次注册到 http.Handle 或 http.HandleFunc，导致 panic。",
  "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": "Go panics on duplicate registration; this is not allowed.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Overriding can lead to unexpected behavior and is not idiomatic.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check if pattern is already registered before adding: if _, exists := mux.Handlers()[pattern]; !exists { mux.Handle(pattern, handler) }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use a single handler with method-based routing: http.HandleFunc(\"/api/v1/users\", func(w http.ResponseWriter, r *http.Request) { switch r.Method { case \"GET\": ... case \"POST\": ... } })",
      "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-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}