# 错误：proto：字段"status"具有无效的枚举值：99

- **ID:** `go/grpc-protobuf-enum-out-of-range`
- **领域:** go
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

protobuf消息包含一个枚举字段，其数值未在.proto文件中定义，通常是由于版本漂移。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.0 | active | — | — |

## 解决方案

1. **Add the missing enum value to the .proto file and regenerate.** (90% 成功率)
   ```
   enum Status { UNKNOWN = 0; ACTIVE = 1; INACTIVE = 2; CUSTOM = 99; }
   ```
2. **Use proto.EnumValueMap to map unknown values to a default.** (60% 成功率)
   ```
   import "google.golang.org/protobuf/types/known/anypb"
// Not directly supported; requires custom unmarshaler
   ```

## 无效尝试

- **Ignore the error and continue processing.** — Unmarshal will fail completely, no partial data. (100% 失败率)
- **Cast the value to int and treat as unknown.** — Protobuf enums are strict; unknown values cause rejection. (95% 失败率)
