From 5d3bc652cbf12000db24df4e48af63304dc95455 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 17 Dec 2014 18:41:02 -0800 Subject: [PATCH] commands/http: client: Close output channel on decoder EOF --- commands/http/client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/http/client.go b/commands/http/client.go index 371ca8756..a32974a74 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -150,10 +150,12 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error for { err := dec.Decode(&v) - if err != nil { - if err != io.EOF { - fmt.Println(err.Error()) - } + if err != nil && err != io.EOF { + fmt.Println(err.Error()) + return + } + if err == io.EOF { + close(outChan) return } outChan <- v