From 82733d4b252f1ea3b2488e4ef63e098ea5db2050 Mon Sep 17 00:00:00 2001 From: Philipp Mieden Date: Tue, 21 May 2019 10:06:21 +0200 Subject: [PATCH] fix: call of Unmarshal passed a non-pointer as second argument --- client/sockettransport.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/sockettransport.go b/client/sockettransport.go index 97b524d..96bb09f 100644 --- a/client/sockettransport.go +++ b/client/sockettransport.go @@ -109,8 +109,10 @@ func (c *socketTransport) call(handler server.Handler, request interface{}, resp responseJSONErr := json.Unmarshal(responseBytes, &serverResponse{Reply: response}) if responseJSONErr != nil { // is it an error ? - remoteErr := responses.Error{} - remoteErrJSONErr := json.Unmarshal(responseBytes, remoteErr) + var ( + remoteErr = responses.Error{} + remoteErrJSONErr = json.Unmarshal(responseBytes, &remoteErr) + ) if remoteErrJSONErr == nil { returnConn(remoteErrJSONErr) return remoteErr