From 0fb69761f0219c1aaf730eaf38da79f45e9f12dc Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Mon, 3 Aug 2015 11:45:42 -0700 Subject: [PATCH] small fix --- clientconn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientconn.go b/clientconn.go index 766d758d..5c20f71e 100644 --- a/clientconn.go +++ b/clientconn.go @@ -236,11 +236,11 @@ func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState Conn if sourceState != cc.state { return true } - done := make(chan struct{}) expired := timeout <= time.Since(start) if expired { return false } + done := make(chan struct{}) go func() { select { case <-time.After(timeout-time.Since(start)):