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 { for {
val, err := next(c.Session.decoder) val, err := next(c.Session.decoder)
if err != nil { if err != nil {
close(receiver)
return err return err
} }
receiver <- val receiver <- val