use defer in conn.Close

This commit is contained in:
Naitik Shah 2013-10-06 10:54:16 -07:00
parent e3a666a3f1
commit 220ebb1f4f

View File

@ -58,9 +58,8 @@ type conn struct {
}
func (c conn) Close() error {
err := c.Conn.Close()
c.wg.Done()
return err
defer c.wg.Done()
return c.Conn.Close()
}
// Wraps an existing File listener to provide a graceful Close() process.