New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined enum number doesn't default to UNKNOWN #1516
Comments
This is working as intended:
https://developers.google.com/protocol-buffers/docs/proto3#enum |
@puellanivis, Thanks for getting back to me. Why can't the enum getter handle this? It already does return the default if
|
It returns the default value if |
What version of protobuf and what language are you using?
Protobuf
v3
protoc-gen-go
v1.28.1
protoc
v3.15.8
Go
1.18.1
What did you do?
PROTO File
Golang Client
Golang Server
What did you expect to see?
The
req.ProductStatus
should have a status ofpb.Product_UNKNOWN
, which is the default value when it can't match the valueWhat did you see instead?
I get
100
when I do in the serverreq.GetProductStatus()
req.ProductStatus
orreq.GetProductStatus().String
The text was updated successfully, but these errors were encountered: