{
  "id": "go/os-file-already-closed",
  "signature": "file already closed",
  "signature_zh": "文件已关闭",
  "regex": "file\\ already\\ closed",
  "domain": "go",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "Attempting to read, write, or close a file that has already been closed, often due to double-close or using a file after defer Close().",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试对已关闭的文件进行读、写或关闭操作，通常是由于双重关闭或在 defer Close() 后使用文件。",
  "versions": [
    {
      "version": "1.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The file pointer is not nil after closing; it's the underlying descriptor that is invalid.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Sync() does not prevent the file from being closed.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use a sync.Once to ensure Close() is called only once.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Set the file variable to nil after Close() and check for nil before using.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}