From ecc2248aa06516856506dba64cbc3a61e41938cc Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 5 Jan 2015 14:19:13 -0800 Subject: [PATCH] commands/http: client: Fixed decoding values in channel output --- commands/http/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/http/client.go b/commands/http/client.go index 903565797..12cad6fe8 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "net/url" + "reflect" "strings" cmds "github.com/jbenet/go-ipfs/commands" @@ -149,7 +150,8 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error outChan := make(chan interface{}) go func() { dec := json.NewDecoder(httpRes.Body) - v := req.Command().Type + outputType := reflect.ValueOf(req.Command().Type).Type() + v := reflect.New(outputType).Interface() for { err := dec.Decode(&v)