@@ -180,8 +180,8 @@ func TestFlightExecutor_MergedContextCallerCancel(t *testing.T) {
180180func TestDisconnectMonitor_DetectsClose (t * testing.T ) {
181181 // Create a connected pair of net.Conn (using net.Pipe).
182182 server , client := net .Pipe ()
183- defer server .Close ()
184- defer client .Close ()
183+ defer func () { _ = server .Close () } ()
184+ defer func () { _ = client .Close () } ()
185185
186186 connCtx , connCancel := context .WithCancel (context .Background ())
187187 defer connCancel ()
@@ -200,7 +200,7 @@ func TestDisconnectMonitor_DetectsClose(t *testing.T) {
200200 defer stop ()
201201
202202 // Close the client side to simulate client disconnect.
203- client .Close ()
203+ _ = client .Close ()
204204
205205 // The monitor should detect the disconnect and cancel connCtx.
206206 select {
@@ -215,8 +215,8 @@ func TestDisconnectMonitor_StopBeforeDisconnect(t *testing.T) {
215215 // Verify that stop() returns promptly and the context is NOT cancelled
216216 // when the connection is still alive.
217217 server , client := net .Pipe ()
218- defer server .Close ()
219- defer client .Close ()
218+ defer func () { _ = server .Close () } ()
219+ defer func () { _ = client .Close () } ()
220220
221221 connCtx , connCancel := context .WithCancel (context .Background ())
222222 defer connCancel ()
@@ -260,8 +260,8 @@ func TestDisconnectMonitor_BufferedDataNotLost(t *testing.T) {
260260 // Verify that data arriving during monitoring stays in the bufio.Reader
261261 // buffer and can be read after the monitor stops.
262262 server , client := net .Pipe ()
263- defer server .Close ()
264- defer client .Close ()
263+ defer func () { _ = server .Close () } ()
264+ defer func () { _ = client .Close () } ()
265265
266266 connCtx , connCancel := context .WithCancel (context .Background ())
267267 defer connCancel ()
0 commit comments