From 2c9c526023802bbdc17678311ed693478cc50c35 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sun, 6 Dec 2020 14:55:00 +0200 Subject: [PATCH] Wait for the goroutine to finish --- redis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redis.go b/redis.go index 88cced7..712579d 100644 --- a/redis.go +++ b/redis.go @@ -316,6 +316,8 @@ func (c *baseClient) withConn( select { case <-done: _ = cn.Close() + // Wait for the goroutine to finish and send something. + <-errc err = ctx.Err() return err