{
  "id": "go/http-request-body-already-closed",
  "signature": "http: request body already closed",
  "signature_zh": "http: 请求体已关闭",
  "regex": "http:\\ request\\ body\\ already\\ closed",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Attempting to read from or close an http.Request.Body that has already been closed, typically due to double-close or reading after the handler has returned.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试读取或关闭已经关闭的http.Request.Body，通常是由于重复关闭或处理器返回后继续读取。",
  "versions": [
    {
      "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": "Silently ignoring leads to incomplete reads and potential data corruption",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Request body is a stream and cannot be reopened; must be buffered upfront if multiple reads needed",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "if body, err := io.ReadAll(r.Body); err == nil { r.Body.Close() }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "defer r.Body.Close() once at start of handler",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}