{
  "id": "go/json-invalid-character-looking-for-beginning",
  "signature": "invalid character '\\x00' looking for beginning of value",
  "signature_zh": "无效字符 '\\x00'，正在查找值的开头",
  "regex": "invalid\\ character\\ '\\\\x00'\\ looking\\ for\\ beginning\\ of\\ value",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The input to the JSON decoder begins with a NUL byte or non-JSON garbage, e.g. binary content, BOM, or an empty gzip stream.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 解码器输入以 NUL 字节或非 JSON 垃圾开头，例如二进制内容、BOM 或空 gzip 流。",
  "versions": [
    {
      "version": "1.18",
      "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": "Does not remove NUL bytes or BOM.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Returns false but gives no insight into the cause.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.85,
      "how": "b = bytes.TrimPrefix(b, []byte{0xEF,0xBB,0xBF})\nb = bytes.Trim(b, \"\\x00\")\nif !json.Valid(b) { return fmt.Errorf(\"invalid json: %q\", b[:min(32,len(b))]) }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Log the first 64 bytes of the body before decoding to diagnose the actual content.",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}