Open blevz opened 3 years ago
I couldn't get it to work originally but I think I need to use this: https://pkg.go.dev/google.golang.org/protobuf/testing/protocmp
Will try it and update if it works
Oh, if that's the package you're using then I think you can give it the message objects directly without translating them to maps. … On Thu, Apr 1, 2021, 9:42 AM Ben Levy @.> wrote: @*.** commented on this pull request. ------------------------------ In configreader/reader_test.go <#7 (comment)>: > + var expectedMap map[string]interface{} + if err := json.Unmarshal(expectedBytes, &expectedMap); err != nil { + t.Error(err) + return + } + actualBytes, err := protojson.Marshal(actual) + if err != nil { + t.Error(err) + return + } + var actualMap map[string]interface{} + if err := json.Unmarshal(actualBytes, &actualMap); err != nil { + t.Error(err) + return + } + if diff := cmp.Diff(expectedMap, actualMap); diff != "" { Isn't that what I'm using here? Should I be using it differently? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRTVVE2QPQGGK7ET6TTOLTGRZ5ZANCNFSM42BGPSBQ .
Oh, if that's the package you're using then I think you can give it the message objects directly without translating them to maps.
On Thu, Apr 1, 2021, 9:42 AM Ben Levy @.***> wrote: