@@ -67,15 +67,15 @@ func TestRetryAfter(t *testing.T) {
67
67
},
68
68
}),
69
69
)
70
- res , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
70
+ _ , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
71
71
Account : cloudflare .F (zones.ZoneNewParamsAccount {
72
72
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
73
73
}),
74
74
Name : cloudflare .F ("example.com" ),
75
75
Type : cloudflare .F (zones .TypeFull ),
76
76
})
77
- if err == nil || res != nil {
78
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
77
+ if err == nil {
78
+ t .Error ("Expected there to be a cancel error" )
79
79
}
80
80
81
81
attempts := len (retryCountHeaders )
@@ -107,15 +107,15 @@ func TestDeleteRetryCountHeader(t *testing.T) {
107
107
}),
108
108
option .WithHeaderDel ("X-Stainless-Retry-Count" ),
109
109
)
110
- res , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
110
+ _ , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
111
111
Account : cloudflare .F (zones.ZoneNewParamsAccount {
112
112
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
113
113
}),
114
114
Name : cloudflare .F ("example.com" ),
115
115
Type : cloudflare .F (zones .TypeFull ),
116
116
})
117
- if err == nil || res != nil {
118
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
117
+ if err == nil {
118
+ t .Error ("Expected there to be a cancel error" )
119
119
}
120
120
121
121
expectedRetryCountHeaders := []string {"" , "" , "" }
@@ -142,15 +142,15 @@ func TestOverwriteRetryCountHeader(t *testing.T) {
142
142
}),
143
143
option .WithHeader ("X-Stainless-Retry-Count" , "42" ),
144
144
)
145
- res , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
145
+ _ , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
146
146
Account : cloudflare .F (zones.ZoneNewParamsAccount {
147
147
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
148
148
}),
149
149
Name : cloudflare .F ("example.com" ),
150
150
Type : cloudflare .F (zones .TypeFull ),
151
151
})
152
- if err == nil || res != nil {
153
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
152
+ if err == nil {
153
+ t .Error ("Expected there to be a cancel error" )
154
154
}
155
155
156
156
expectedRetryCountHeaders := []string {"42" , "42" , "42" }
@@ -176,15 +176,15 @@ func TestRetryAfterMs(t *testing.T) {
176
176
},
177
177
}),
178
178
)
179
- res , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
179
+ _ , err := client .Zones .New (context .Background (), zones.ZoneNewParams {
180
180
Account : cloudflare .F (zones.ZoneNewParamsAccount {
181
181
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
182
182
}),
183
183
Name : cloudflare .F ("example.com" ),
184
184
Type : cloudflare .F (zones .TypeFull ),
185
185
})
186
- if err == nil || res != nil {
187
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
186
+ if err == nil {
187
+ t .Error ("Expected there to be a cancel error" )
188
188
}
189
189
if want := 3 ; attempts != want {
190
190
t .Errorf ("Expected %d attempts, got %d" , want , attempts )
@@ -204,15 +204,15 @@ func TestContextCancel(t *testing.T) {
204
204
)
205
205
cancelCtx , cancel := context .WithCancel (context .Background ())
206
206
cancel ()
207
- res , err := client .Zones .New (cancelCtx , zones.ZoneNewParams {
207
+ _ , err := client .Zones .New (cancelCtx , zones.ZoneNewParams {
208
208
Account : cloudflare .F (zones.ZoneNewParamsAccount {
209
209
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
210
210
}),
211
211
Name : cloudflare .F ("example.com" ),
212
212
Type : cloudflare .F (zones .TypeFull ),
213
213
})
214
- if err == nil || res != nil {
215
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
214
+ if err == nil {
215
+ t .Error ("Expected there to be a cancel error" )
216
216
}
217
217
}
218
218
@@ -229,15 +229,15 @@ func TestContextCancelDelay(t *testing.T) {
229
229
)
230
230
cancelCtx , cancel := context .WithTimeout (context .Background (), 2 * time .Millisecond )
231
231
defer cancel ()
232
- res , err := client .Zones .New (cancelCtx , zones.ZoneNewParams {
232
+ _ , err := client .Zones .New (cancelCtx , zones.ZoneNewParams {
233
233
Account : cloudflare .F (zones.ZoneNewParamsAccount {
234
234
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
235
235
}),
236
236
Name : cloudflare .F ("example.com" ),
237
237
Type : cloudflare .F (zones .TypeFull ),
238
238
})
239
- if err == nil || res != nil {
240
- t .Error ("expected there to be a cancel error and for the response to be nil " )
239
+ if err == nil {
240
+ t .Error ("expected there to be a cancel error" )
241
241
}
242
242
}
243
243
@@ -260,15 +260,15 @@ func TestContextDeadline(t *testing.T) {
260
260
},
261
261
}),
262
262
)
263
- res , err := client .Zones .New (deadlineCtx , zones.ZoneNewParams {
263
+ _ , err := client .Zones .New (deadlineCtx , zones.ZoneNewParams {
264
264
Account : cloudflare .F (zones.ZoneNewParamsAccount {
265
265
ID : cloudflare .F ("023e105f4ecef8ad9ca31a8372d0c353" ),
266
266
}),
267
267
Name : cloudflare .F ("example.com" ),
268
268
Type : cloudflare .F (zones .TypeFull ),
269
269
})
270
- if err == nil || res != nil {
271
- t .Error ("expected there to be a deadline error and for the response to be nil " )
270
+ if err == nil {
271
+ t .Error ("expected there to be a deadline error" )
272
272
}
273
273
close (testDone )
274
274
}()
0 commit comments