{
  "id": "go/protobuf-required-field-missing",
  "signature": "proto: required field \"pb.User.id\" not set",
  "signature_zh": "proto: 必填字段 \"pb.User.id\" 未设置",
  "regex": "proto:\\ required\\ field\\ \"pb\\.User\\.id\"\\ not\\ set",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A message defined with proto2 `required` fields was marshaled or unmarshaled without the required field set. Proto3 has no required fields, so this only occurs with proto2 or gogo/protobuf.",
  "root_cause_type": "generic",
  "root_cause_zh": "定义了 proto2 `required` 字段的消息在序列化或反序列化时未设置必填字段。proto3 没有必填字段，因此这只发生在 proto2 或 gogo/protobuf 中。",
  "versions": [
    {
      "version": "google.golang.org/protobuf 1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "proto2 treats zero value as unset for scalar required fields; still fails.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Breaking change for existing wire consumers; migration is non-trivial.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "id := int64(42)\nmsg := &pb.User{Id: &id}\nif err := proto.Marshal(msg); err != nil { return err }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "// user.proto (proto3)\nmessage User {\n  optional int64 id = 1;\n}",
      "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": "2025-06-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}