提交 5d3bc652 作者: Matt Bell

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

上级 0452a5f7
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论