aboutsummaryrefslogtreecommitdiff
path: root/test_msgnet
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-11 01:59:04 -0400
committerDeterminant <[email protected]>2019-06-11 01:59:04 -0400
commit1b2215ae2c792f96765a15c7ffcc6f20e3046cc7 (patch)
treee42e4d9f86c39130387da65765ca2a4b315722d9 /test_msgnet
parentdf87359ec575622687b5f6b8319fb30ba4340caf (diff)
fix slice bugs
Diffstat (limited to 'test_msgnet')
-rw-r--r--test_msgnet/main.go6
1 files changed, 3 insertions, 3 deletions
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 }
}