defer the Done() call

This commit is contained in:
rubyist 2013-11-03 13:47:47 -05:00
parent c846d177f2
commit 43ccb346c3

View File

@ -64,7 +64,7 @@ type conn struct {
} }
func (c *conn) Close() error { func (c *conn) Close() error {
c.once.Do(func() { c.wg.Done() }) c.once.Do(func() { defer c.wg.Done() })
return c.Conn.Close() return c.Conn.Close()
} }