{
  "id": "go/io-write-to-closed-pipe",
  "signature": "panic: write to closed pipe",
  "signature_zh": "恐慌：写入已关闭的管道",
  "regex": "panic:\\ write\\ to\\ closed\\ pipe",
  "domain": "go",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "Writing to a pipe after the read end has been closed, often due to premature closure of the reader.",
  "root_cause_type": "generic",
  "root_cause_zh": "在读取端关闭后写入管道，通常由于读取器过早关闭。",
  "versions": [
    {
      "version": "1.20",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignoring SIGPIPE signal",
      "why_fails": "Signal handling may not prevent panic; use proper synchronization.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use io.Pipe with proper error handling and synchronization",
      "success_rate": 0.9,
      "how": "pr, pw := io.Pipe()\n// writer goroutine\ngo func() {\n    defer pw.Close()\n    _, err := pw.Write(data)\n    if err != nil { log.Println(err) }\n}()\n// reader\ndata, err := io.ReadAll(pr)",
      "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": "2026-04-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}