{
  "id": "go/encoding-json-marshal-non-addressable-value",
  "signature": "panic: json: calling MarshalJSON for type main.MyType with non-addressable value",
  "signature_zh": "恐慌：json：为类型main.MyType调用MarshalJSON时使用了不可寻址的值",
  "regex": "panic:\\ json:\\ calling\\ MarshalJSON\\ for\\ type\\ main\\.MyType\\ with\\ non\\-addressable\\ value",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Attempting to marshal a value that is not addressable, such as a map key, which cannot have its method called.",
  "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": "Using reflect to make it addressable",
      "why_fails": "Complex and may panic; better to use pointer receiver.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure MarshalJSON has pointer receiver and pass pointer",
      "success_rate": 0.9,
      "how": "func (m *MyType) MarshalJSON() ([]byte, error) { ... }\n// Always pass pointer\njson.Marshal(&myValue)",
      "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.8,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}