Move defer outside the closure

This commit is contained in:
rubyist 2013-11-04 06:57:07 -05:00
parent 43ccb346c3
commit 906a8cad55

View File

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