From 4297e9bd91c9b33962d65d2da22ae9e4b826baa2 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Mon, 3 Aug 2015 13:18:25 -0700 Subject: [PATCH] revert some unnecessary changes --- clientconn.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clientconn.go b/clientconn.go index 8d4e1f2f..5c20f71e 100644 --- a/clientconn.go +++ b/clientconn.go @@ -241,16 +241,16 @@ func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState Conn return false } done := make(chan struct{}) - go func(expired *bool) { + go func() { select { case <-time.After(timeout-time.Since(start)): cc.mu.Lock() - *expired = true + expired = true cc.stateCV.Broadcast() cc.mu.Unlock() case <-done: } - }(&expired) + }() defer close(done) for sourceState == cc.state { cc.stateCV.Wait()