{
  "id": "go/io-copy-buffer-too-small",
  "signature": "error: io: read/write on closed pipe (buffer too small for atomic write)",
  "signature_zh": "错误：io：在已关闭的管道上读/写（缓冲区太小，无法进行原子写入）",
  "regex": "error:\\ io:\\ read/write\\ on\\ closed\\ pipe\\ \\(buffer\\ too\\ small\\ for\\ atomic\\ write\\)",
  "domain": "go",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "Using io.Copy with a buffer that is too small for atomic operations, causing partial writes and pipe closure.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用io.Copy时缓冲区太小，无法进行原子操作，导致部分写入和管道关闭。",
  "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": "Increasing buffer size arbitrarily",
      "why_fails": "May not fix underlying issue; use io.CopyBuffer with larger buffer.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use io.Copy with default buffer or specify larger buffer",
      "success_rate": 0.9,
      "how": "buf := make([]byte, 32*1024) // 32KB buffer\n_, err := io.CopyBuffer(dst, src, buf)\nif err != nil { /* handle */ }",
      "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.81,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}