From 48bc14b3e0bc9a53f1bc912da8ecbb125cdeed14 Mon Sep 17 00:00:00 2001 From: Theo McGinley Date: Sat, 9 Feb 2019 15:48:27 +0000 Subject: [PATCH] Closed receiver chan on error --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index d167341..2983b81 100644 --- a/client.go +++ b/client.go @@ -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