# proto: required field "User.email" not set

- **ID:** `go/proto-required-field-not-set`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

proto2 required fields must be explicitly set before marshaling. In proto3 there are no required fields, so this only appears with proto2 or legacy generated code.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| github.com/golang/protobuf v1.5 / proto2 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   u.Email = proto.String("user@example.com")
if err := proto.Marshal(u); err != nil {
    log.Fatalf("marshal: %v", err)
}
   ```
2. **** (80% success)
   ```
   // user.proto: syntax = "proto3";
// string email = 1 [ (validate.rules).string.email = true ];
   ```

## Dead Ends

- **** — Marshaling is deterministic; an unset required field stays unset. Retrying never fills the field. (95% fail)
- **** — Regenerating changes the API; callers relying on presence semantics may now send empty values silently. (50% fail)
