{
  "id": "go/protobuf-reflection-nil-descriptor",
  "signature": "panic: proto: message pb.User does not implement protoreflect.ProtoMessage",
  "signature_zh": "panic: proto: 消息 pb.User 未实现 protoreflect.ProtoMessage",
  "regex": "panic:\\ proto:\\ message\\ pb\\.User\\ does\\ not\\ implement\\ protoreflect\\.ProtoMessage",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A struct is being passed to proto.Marshal that was not generated by protoc-gen-go (or was generated by the old github.com/golang/protobuf plugin). It lacks the ProtoReflect() method required by the new API.",
  "root_cause_type": "generic",
  "root_cause_zh": "传给 proto.Marshal 的结构体不是由 protoc-gen-go 生成的（或由旧版 github.com/golang/protobuf 插件生成）。它缺少新 API 所需的 ProtoReflect() 方法。",
  "versions": [
    {
      "version": "google.golang.org/protobuf 1.28+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Returns a nil descriptor; reflection and marshaling still fail at runtime.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Produces JSON, not protobuf wire format; peers expecting protobuf cannot decode.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\nprotoc --go_out=. --go_opt=paths=source_relative user.proto",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "// Remove github.com/golang/protobuf imports; use google.golang.org/protobuf/proto\nimport \"google.golang.org/protobuf/proto\"\nb, err := proto.Marshal(&pb.User{...})",
      "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": "2025-03-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}