Closed receiver chan on error

This commit is contained in:
Theo McGinley 2019-02-09 15:48:27 +00:00
parent c0f3d20440
commit 48bc14b3e0

View File

@ -150,6 +150,7 @@ func (c *Client) recv(receiver chan<- interface{}) (err error) {
for {
val, err := next(c.Session.decoder)
if err != nil {
close(receiver)
return err
}
receiver <- val