# panic: proto: message pb.User does not implement protoreflect.ProtoMessage

- **ID:** `go/protobuf-reflection-nil-descriptor`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/protobuf 1.28+ | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
protoc --go_out=. --go_opt=paths=source_relative user.proto
   ```
2. **** (90% success)
   ```
   // Remove github.com/golang/protobuf imports; use google.golang.org/protobuf/proto
import "google.golang.org/protobuf/proto"
b, err := proto.Marshal(&pb.User{...})
   ```

## Dead Ends

- **** — Returns a nil descriptor; reflection and marshaling still fail at runtime. (85% fail)
- **** — Produces JSON, not protobuf wire format; peers expecting protobuf cannot decode. (70% fail)
