# proto: required field "name" not set

- **ID:** `go/protobuf-missing-required-field`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A proto2 message with required fields was not fully populated before serialization. In proto3, required fields are not supported, but if using proto2, this error occurs.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   msg := &YourMessage{
    Name: proto.String("value"), // Required field
}
if err := proto.Marshal(msg); err != nil {
    log.Fatalf("marshal failed: %v", err)
}
   ```
2. **** (90% success)
   ```
   // Update .proto file to syntax = "proto3";
// Remove required keyword; regenerate code
   ```

## Dead Ends

- **** — Serialization will still fail or produce invalid data that cannot be parsed later. (100% fail)
- **** — An empty string is still a value, but if the field is required, it must be explicitly set; an empty string may be considered unset in some implementations. (70% fail)
