From 966bc2251727ba9a79e331a959389dca3cb8b736 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 10 Jan 2023 14:50:41 +0100 Subject: [PATCH] rename MustUnmarshal -> Unmarshal and Unmarshal -> TryUnmarshal, panic by default --- ipcmsg.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipcmsg.go b/ipcmsg.go index 5d9cc22..c9130f1 100644 --- a/ipcmsg.go +++ b/ipcmsg.go @@ -329,13 +329,13 @@ func (msg *IPCMessage) Type() IPCMsgType { return msg.hdr.Type } -func (msg *IPCMessage) Unmarshal(v interface{}) error { +func (msg *IPCMessage) TryUnmarshal(v interface{}) error { dec := gob.NewDecoder(bytes.NewBuffer(msg.data)) return dec.Decode(v) } -func (msg *IPCMessage) MustUnmarshal(v interface{}) { - err := msg.Unmarshal(v) +func (msg *IPCMessage) Unmarshal(v interface{}) { + err := msg.TryUnmarshal(v) if err != nil { panic(err) }