From 2be2f12b358dc57d70b8f501b00be450192efbc3 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 19 Feb 2018 18:36:29 -0600 Subject: [PATCH] rpcclient: Update for go1.10 breaking changes. Go 1.10 made some changes such that json.Unmarshal can no longer unmarshal into exported fields that are themselves embedded via an uninitialized unexported pointer. Since rpcclient previously relied on this behavior, this updates the client to create the pointers before unmarshalling into the struct. --- rpcclient/infrastructure.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpcclient/infrastructure.go b/rpcclient/infrastructure.go index fe195cd7..27f7f21f 100644 --- a/rpcclient/infrastructure.go +++ b/rpcclient/infrastructure.go @@ -310,6 +310,8 @@ func (c *Client) handleMessage(msg []byte) { // Attempt to unmarshal the message as either a notification or // response. var in inMessage + in.rawResponse = new(rawResponse) + in.rawNotification = new(rawNotification) err := json.Unmarshal(msg, &in) if err != nil { log.Warnf("Remote server sent invalid message: %v", err)