Skip to content
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

Compatibility Issue with status.WithDetails Using google.golang.org/protobuf/proto Package #6588

Closed
squareheadc opened this issue Aug 27, 2023 · 1 comment

Comments

@squareheadc
Copy link

What version of gRPC are you using?

google.golang.org/grpc v1.57.0

What version of Go are you using (go version)?

go 1.21.0

What operating system (Linux, Windows, …) and version?

macOS

What did you do?

I was trying to call status.WithDetails using a slice of []proto.Message from the recommended library google.golang.org/protobuf/proto. Here is my code snippet:

var detail []proto.Message
se := status.New(codes.InvalidArgument, "Invalid Example")
seWithDetails, err := se.WithDetails(detail...)

What did you expect to see?

I expected to call status.WithDetails without any issues using the recommended google.golang.org/protobuf/proto package.

What did you see instead?

I encountered an error that prevents me from using the call as intended:

cannot use detail (variable of type []protoreflect.ProtoMessage) as []protoiface.MessageV1 value in argument to se.WithDetails

Since the github.com/golang/protobuf package is deprecated, the use of github.com/golang/protobuf within the status package conflicts with the recommended package. Could you please check and provide a workaround or update the package to make it compatible with the recommended package?

@dfawley
Copy link
Member

dfawley commented Aug 29, 2023

Please see #5316

@dfawley dfawley closed this as completed Aug 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants