-
Notifications
You must be signed in to change notification settings - Fork 555
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
ShouldResemble for proto messages #664
Comments
Hey Antonio, note that you can define your own ShouldResembleProto and use that with GoConvey. That's exactly what the Chrome infrastructure team has done, as they're big users of GoConvey and of Protocol Buffers. I'd be curious for @riannucci to chime in, but it might be weird for GoConvey to pull in the protobuf repo as a dependency to make this natively supported. Have a look at these: |
Comparison of proto Messages performed using
ShouldResemble
is unreliable.Consider this code:
The call to
Printf
causesx.String()
to be called. This in turn initializes thestate
and itsatomicMessageInfo
field on the proto message. Thereforex
has theatomicMessageInfo
set, whiley
doesn't. This causesreflect.DeepEqual
to return false.Another problem stems from the rendering of the diff (#660).
Could a
ShouldResembleProto
be added for expliciting comparing proto messages? It should callproto.Equal
.The text was updated successfully, but these errors were encountered: