{
  "id": "go/protobuf-duplicate-field-number",
  "signature": "panic: proto: duplicate field number 5 in message pb.User",
  "signature_zh": "panic: proto: 消息 pb.User 中字段编号 5 重复",
  "regex": "panic:\\ proto:\\ duplicate\\ field\\ number\\ 5\\ in\\ message\\ pb\\.User",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Two fields in the same message share a field number, which protobuf forbids. This usually arises from hand-editing generated code or merging conflicting .proto definitions.",
  "root_cause_type": "generic",
  "root_cause_zh": "同一消息中的两个字段共享相同的字段编号，protobuf 禁止此行为。通常由手工编辑生成代码或合并冲突的 .proto 定义引起。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The duplicate numbering corrupts wire format; removing the check produces silent data corruption instead of a clear failure.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The number, not the name, is what must be unique; the panic persists.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Assign a unique field number to each field in the .proto, then regenerate with protoc --go_out=. --go-grpc_out=. and never hand-edit generated files.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use reserved field numbers to prevent reuse: reserved 5; when removing a field, and run buf lint to catch duplicate numbers at build time.",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-01-09",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}