Skip to content

Commit

Permalink
rename MustUnmarshal -> Unmarshal and Unmarshal -> TryUnmarshal, pani…
Browse files Browse the repository at this point in the history
…c by default
  • Loading branch information
poolpOrg committed Jan 10, 2023
1 parent bf5a7ae commit 966bc22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipcmsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 966bc22

Please sign in to comment.