# panic: proto: field pb.User.labels contains invalid nil map value

- **ID:** `go/protobuf-marshal-nil-map`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A proto map field was assigned a map with a nil value (e.g. map[string]*Meta{"k": nil}), which the protobuf runtime rejects during marshal.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/protobuf 1.x | active | — | — |

## Workarounds

1. **** (92% success)
   ```
   labels := make(map[string]*pb.Meta)
for k, v := range src {
  if v == nil { continue }
  labels[k] = v
}
msg.Labels = labels
   ```
2. **** (88% success)
   ```
   // user.proto
message User {
  map<string, Meta> labels = 1;
}
   ```

## Dead Ends

- **** — Swallowing the panic leaves the message unsent and corrupts control flow. (85% fail)
- **** — Data loss and hidden bugs; the caller has no signal that data was dropped. (70% fail)
