commands/http: client: Close output channel on decoder EOF

This commit is contained in:
Matt Bell 2014-12-17 18:41:02 -08:00
parent 0452a5f75e
commit 5d3bc652cb

View File

@ -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