You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errors: migrate from gogo/protobuf to google.golang.org/protobuf
github.com/gogo/protobuf, along with the related github.com/gogo/status
and github.com/gogo/googleapis, is deprecated and unmaintained. This
migrates the whole module to the standard, maintained protobuf stack it
already depended on: google.golang.org/protobuf (+ anypb),
google.golang.org/grpc/status, and
google.golang.org/genproto/googleapis/rpc/status.
The .proto files are regenerated with the standard protoc-gen-go and
protoc-gen-go-grpc, dropping the custom protoc-gen-gogoroach plugin and
all gogoproto options, and the hand-written code is adapted to the v2
runtime:
- errbase packs and unpacks error detail payloads with anypb.New and
(*anypb.Any).UnmarshalNew, resolving types through the standard
protoregistry instead of gogo's registry.
- The previously non-nullable embedded fields (Details, Cause,
ErrorTypeMark) are now pointers, read through the generated nil-safe
getters. DecodeError takes *EncodedError and GetTypeMark returns
*errorspb.ErrorTypeMark accordingly.
- extgrpc and grpc/middleware use google.golang.org/grpc/status. Because
the standard Any can hold standard protobufs directly, the former
gogo/standard status split collapses into a single path, and
google.rpc.Status now comes from genproto with the same type URL.
- go.mod drops all three gogo modules.
Wire compatibility is preserved: no proto package/message name or field
number changes, and google.protobuf.Any type URLs are unchanged, so
errors serialized by the previous gogo-based version still decode here
and vice versa.
This is a breaking API change (major version): the encoder/decoder
registration interfaces now reference the v2 proto.Message, so consumers
that register custom error types must supply standard-protobuf payloads.
Errors originally produced as github.com/gogo/status types decode to an
opaque error (message and safe details preserved) rather than being
reconstructed as a gRPC status.
Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
0 commit comments