Commit 363e6e61 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/zeo: msgpack.{Encode,Decode} -> msgpack.{Marshal,Unmarshal}

Encode/decode was deprecated and removed in recent github.com/shamaton/msgpack.
parent be36b5ee
// Copyright (C) 2018-2020 Nexedi SA and Contributors. // Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -104,7 +104,7 @@ func pktEncodeM(m msg) *pktBuf { ...@@ -104,7 +104,7 @@ func pktEncodeM(m msg) *pktBuf {
// arg // arg
// it is interface{} - use shamaton/msgpack since msgp does not handle // it is interface{} - use shamaton/msgpack since msgp does not handle
// arbitrary interfaces well. // arbitrary interfaces well.
dataArg, err := msgpack.Encode(m.arg) dataArg, err := msgpack.Marshal(m.arg)
if err != nil { if err != nil {
panic(err) // all our types are expected to be supported by msgpack panic(err) // all our types are expected to be supported by msgpack
} }
...@@ -240,7 +240,7 @@ func pktDecodeM(pkb *pktBuf) (msg, error) { ...@@ -240,7 +240,7 @@ func pktDecodeM(pkb *pktBuf) (msg, error) {
if len(btail) != 0 { if len(btail) != 0 {
return m, derrf(".%d: payload has extra data after message") return m, derrf(".%d: payload has extra data after message")
} }
err = msgpack.Decode(b, &m.arg) err = msgpack.Unmarshal(b, &m.arg)
if err != nil { if err != nil {
return m, derrf(".%d: arg: %s", m.msgid, err) return m, derrf(".%d: arg: %s", m.msgid, err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment