From abcf3428eab20d41baff2e2ebe20561cc51d0bd6 Mon Sep 17 00:00:00 2001 From: Ben Echols Date: Fri, 29 Sep 2023 09:01:21 -0600 Subject: [PATCH] two small changes from upgrading proto import --- cmd/wowsimcli/cmd/decode_link.go | 2 +- sim/core/bulksim_test.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/wowsimcli/cmd/decode_link.go b/cmd/wowsimcli/cmd/decode_link.go index bb7aa2d15b..720ccdddf7 100644 --- a/cmd/wowsimcli/cmd/decode_link.go +++ b/cmd/wowsimcli/cmd/decode_link.go @@ -62,6 +62,6 @@ func decodeLink(link string) error { return fmt.Errorf("cannot unmarshal raw proto: %w", err) } - fmt.Println(protojson.Format(goproto.MessageV2(settings))) + fmt.Println(protojson.Format(goproto.Message(settings))) return nil } diff --git a/sim/core/bulksim_test.go b/sim/core/bulksim_test.go index 3defe75e8c..8dbfafa9f1 100644 --- a/sim/core/bulksim_test.go +++ b/sim/core/bulksim_test.go @@ -107,7 +107,15 @@ func TestBulkSim(t *testing.T) { want := &proto.BulkSimResult{} if diff := cmp.Diff(want, got, cmp.Comparer(func(a, b *proto.BulkSimResult) bool { - return goproto.MarshalTextString(a) == goproto.MarshalTextString(b) + am, err := goproto.Marshal(a) + if err != nil { + return false + } + bm, err := goproto.Marshal(b) + if err != nil { + return false + } + return string(am) == string(bm) })); diff != "" { t.Fatalf("BulkSim() returned diff (-want +got):\n%s", diff) }