Merge pull request #17 from TheoMcGinley/close-channel-after-error

Closed receiver chan on error
This commit is contained in:
Mickaël Rémond 2019-02-09 22:49:38 +01:00 committed by GitHub
commit da4ae4693e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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