use defer in conn.Close
This commit is contained in:
parent
e3a666a3f1
commit
220ebb1f4f
5
grace.go
5
grace.go
@ -58,9 +58,8 @@ type conn struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c conn) Close() error {
|
func (c conn) Close() error {
|
||||||
err := c.Conn.Close()
|
defer c.wg.Done()
|
||||||
c.wg.Done()
|
return c.Conn.Close()
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wraps an existing File listener to provide a graceful Close() process.
|
// Wraps an existing File listener to provide a graceful Close() process.
|
||||||
|
Loading…
Reference in New Issue
Block a user