From 1b2215ae2c792f96765a15c7ffcc6f20e3046cc7 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 11 Jun 2019 01:59:04 -0400 Subject: fix slice bugs --- test_msgnet/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test_msgnet/main.go') diff --git a/test_msgnet/main.go b/test_msgnet/main.go index 0da5af7..230bd83 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -45,9 +45,9 @@ func msgHelloSerialize(name string, text string) salticidae.Msg { func msgHelloUnserialize(msg salticidae.Msg) MsgHello { p := msg.GetPayload() - length := binary.LittleEndian.Uint32(p.GetData(4)) - name := string(p.GetData(int(length))) - text := string(p.GetData(p.Size())) + length := binary.LittleEndian.Uint32(p.GetDataInPlace(4)) + name := string(p.GetDataInPlace(int(length))) + text := string(p.GetDataInPlace(p.Size())) p.Free() return MsgHello { name: name, text: text } } -- cgit v1.2.3