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
Since #4855, attribute values must either implement Equal(o interface{}) bool or be comparable.
This previously wasn't the case and this restriction isn't documented as far as I can tell.
https://pkg.go.dev/google.golang.org/grpc/attributes mentions that keys must be hashable, but does not mention that values must be comparable [if they don't implement Equal]. That information can maybe be derived from If Equal is not implemented, standard equality is used to determine if the two values are equal., but I think it could be more clear.
I would prefer that it was possible to use un-comparable standard types (e.g. using https://pkg.go.dev/github.com/google/go-cmp/cmp as the fallback comparator), but if that isn't possible, I think there should be some documentation indicating directly that values need to be comparable.
We saw this panic in services after a gRPC version bump.
What version of gRPC are you using?
grpc@v1.43.0
What version of Go are you using (go version)?
Go playground
What operating system (Linux, Windows, …) and version?
Since #4855, attribute values must either implement
Equal(o interface{}) bool
or be comparable.This previously wasn't the case and this restriction isn't documented as far as I can tell.
https://pkg.go.dev/google.golang.org/grpc/attributes mentions that keys must be hashable, but does not mention that values must be comparable [if they don't implement
Equal
]. That information can maybe be derived fromIf Equal is not implemented, standard equality is used to determine if the two values are equal.
, but I think it could be more clear.I would prefer that it was possible to use un-comparable standard types (e.g. using https://pkg.go.dev/github.com/google/go-cmp/cmp as the fallback comparator), but if that isn't possible, I think there should be some documentation indicating directly that values need to be comparable.
We saw this panic in services after a gRPC version bump.
What version of gRPC are you using?
grpc@v1.43.0
What version of Go are you using (
go version
)?Go playground
What operating system (Linux, Windows, …) and version?
Go playground
What did you do?
Executed https://go.dev/play/p/TYD55tjljGj
What did you expect to see?
True or false
What did you see instead?
A panic
The text was updated successfully, but these errors were encountered: