File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ func TestClientServer(t *testing.T) {
121
121
if err != nil {
122
122
t .Fatal ("Listen:" , err )
123
123
}
124
- defer func () {
124
+ t . Cleanup ( func () {
125
125
if lis == nil {
126
126
return // already closed
127
127
}
@@ -130,7 +130,7 @@ func TestClientServer(t *testing.T) {
130
130
t .Fatal (err )
131
131
}
132
132
}
133
- }()
133
+ }) ()
134
134
135
135
ha := testHandlerA {t : t }
136
136
go func () {
@@ -184,11 +184,11 @@ func TestClientServer(t *testing.T) {
184
184
func testClientServer (ctx context.Context , t * testing.T , stream jsonrpc2.ObjectStream ) {
185
185
hb := testHandlerB {t : t }
186
186
cc := jsonrpc2 .NewConn (ctx , stream , & hb )
187
- defer func () {
187
+ t . Cleanup ( func () {
188
188
if err := cc .Close (); err != nil {
189
189
t .Fatal (err )
190
190
}
191
- }()
191
+ }) ()
192
192
193
193
// Simple
194
194
const n = 100
You can’t perform that action at this time.
0 commit comments