diff --git a/conn.go b/conn.go index 17d2d6b5..052b1e32 100644 --- a/conn.go +++ b/conn.go @@ -179,7 +179,7 @@ func (c *Conn) clearWriteTimeout() { func (c *Conn) setupReadTimeout(ctx context.Context) { hammerTime := context.AfterFunc(ctx, func() { - defer c.close() + c.close() }) if closer := c.readTimeoutCloser.Swap(hammerTime); closer != nil {