{
  "id": "go/protobuf-marshal-required-field-missing",
  "signature": "proto: required field \"pb.YourMessage.id\" not set",
  "signature_zh": "proto: 必需字段 \"pb.YourMessage.id\" 未设置",
  "regex": "proto:\\ required\\ field\\ \"pb\\.YourMessage\\.id\"\\ not\\ set",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The protobuf message has a required field (proto2) that was not set before marshaling.",
  "root_cause_type": "generic",
  "root_cause_zh": "protobuf 消息具有未在编组前设置的必需字段（proto2）。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Changing the proto definition may break compatibility with other services and requires regeneration.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Migrating to proto3 is a significant change and may not be feasible for existing systems.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "msg := &pb.YourMessage{\n    Id: proto.String(\"some-id\"),\n    // set other required fields\n}\ndata, err := proto.Marshal(msg)\nif err != nil { log.Fatal(err) }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "if err := proto.CheckInitialized(msg); err != nil {\n    log.Fatalf(\"message not initialized: %v\", err)\n}\ndata, err := proto.Marshal(msg)",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}