{
  "id": "go/io-read-at-least-error",
  "signature": "io.ReadAtLeast: unexpected EOF",
  "signature_zh": "io.ReadAtLeast: 意外的 EOF",
  "regex": "io.ReadAtLeast: unexpected EOF",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The io.ReadAtLeast function expected to read at least N bytes from a reader, but the reader returned EOF before providing enough data, indicating a truncated or incomplete stream.",
  "root_cause_type": "generic",
  "root_cause_zh": "io.ReadAtLeast 函数期望从读取器中读取至少 N 个字节，但读取器在提供足够数据之前返回了 EOF，表明流被截断或不完整。",
  "versions": [
    {
      "version": "go1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "go1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "go1.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The issue is not buffer size but the reader ending early; larger buffers won't help if the source is truncated.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The data is incomplete and may cause corruption or panics later; the error is important to handle.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the data source for truncation: if reading a file, verify file size with `os.Stat` before reading; if network stream, ensure the sender transmits the full content.",
      "success_rate": 0.9,
      "how": "Check the data source for truncation: if reading a file, verify file size with `os.Stat` before reading; if network stream, ensure the sender transmits the full content.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `io.ReadFull` instead of `io.ReadAtLeast` and handle the error gracefully, e.g., by returning a custom error or logging the incomplete read.",
      "success_rate": 0.85,
      "how": "Use `io.ReadFull` instead of `io.ReadAtLeast` and handle the error gracefully, e.g., by returning a custom error or logging the incomplete read.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the data source for truncation: if reading a file, verify file size with `os.Stat` before reading; if network stream, ensure the sender transmits the full content.",
    "Use `io.ReadFull` instead of `io.ReadAtLeast` and handle the error gracefully, e.g., by returning a custom error or logging the incomplete read."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pkg.go.dev/io#ReadAtLeast",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.81,
  "fix_success_rate": 0.88,
  "resolvable": "partial",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}