From 2c96d0a152cc7e6b201aaf6df28cba22a3452d08 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 12 Jan 2018 16:21:27 -0800 Subject: [PATCH] ttrpc: return correct error on (*Client).Close Because `shutdownErr` will likely be `nil` in the close select branch, returning it to waiters will result in the waiting `(*Client).Call` returning `(nil, nil)`. This should take whatever is set for the client as the exit condition, which is likely to be `ErrClosed`. Signed-off-by: Stephen J Day --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index ae367f9..39f3bb7 100644 --- a/client.go +++ b/client.go @@ -199,7 +199,7 @@ func (c *Client) run() { } // broadcast the shutdown error to the remaining waiters. for _, waiter := range waiters { - waiter.errs <- shutdownErr + waiter.errs <- c.err } return }