@@ -109,7 +109,7 @@ func TestDownloadFromURL(t *testing.T) {
109109 w .Header ().Set ("Content-Type" , "image/png" )
110110 w .Header ().Set ("Content-Disposition" , `attachment; filename="photo.png"` )
111111 w .WriteHeader (http .StatusOK )
112- w .Write (imageData )
112+ _ , _ = w .Write (imageData )
113113 }))
114114 defer server .Close ()
115115
@@ -142,7 +142,7 @@ func TestDownload_StructuredErrors(t *testing.T) {
142142 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
143143 w .Header ().Set ("Content-Type" , "application/json" )
144144 w .WriteHeader (http .StatusNotFound )
145- w .Write ([]byte (`{"message":"content not found","trackingId":"test-123"}` ))
145+ _ , _ = w .Write ([]byte (`{"message":"content not found","trackingId":"test-123"}` ))
146146 }))
147147 defer server .Close ()
148148
@@ -169,7 +169,7 @@ func TestDownload_410Gone_InfectedFile(t *testing.T) {
169169 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
170170 w .Header ().Set ("Content-Type" , "application/json" )
171171 w .WriteHeader (http .StatusGone )
172- w .Write ([]byte (`{"message":"file is infected and unavailable"}` ))
172+ _ , _ = w .Write ([]byte (`{"message":"file is infected and unavailable"}` ))
173173 }))
174174 defer server .Close ()
175175
@@ -189,7 +189,7 @@ func TestDownload_428PreconditionRequired_UnscannableFile(t *testing.T) {
189189 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
190190 w .Header ().Set ("Content-Type" , "application/json" )
191191 w .WriteHeader (428 )
192- w .Write ([]byte (`{"message":"file cannot be scanned"}` ))
192+ _ , _ = w .Write ([]byte (`{"message":"file cannot be scanned"}` ))
193193 }))
194194 defer server .Close ()
195195
@@ -211,14 +211,14 @@ func TestDownloadWithOptions_AllowUnscannable(t *testing.T) {
211211 // Verify allow=unscannable query parameter
212212 if r .URL .Query ().Get ("allow" ) != "unscannable" {
213213 w .WriteHeader (428 )
214- w .Write ([]byte (`{"message":"file cannot be scanned"}` ))
214+ _ , _ = w .Write ([]byte (`{"message":"file cannot be scanned"}` ))
215215 return
216216 }
217217
218218 w .Header ().Set ("Content-Type" , "application/octet-stream" )
219219 w .Header ().Set ("Content-Disposition" , `attachment; filename="encrypted.zip"` )
220220 w .WriteHeader (http .StatusOK )
221- w .Write (fileData )
221+ _ , _ = w .Write (fileData )
222222 }))
223223 defer server .Close ()
224224
@@ -246,7 +246,7 @@ func TestDownloadWithOptions_NilOptions(t *testing.T) {
246246 }
247247 w .Header ().Set ("Content-Type" , "text/plain" )
248248 w .WriteHeader (http .StatusOK )
249- w .Write (fileData )
249+ _ , _ = w .Write (fileData )
250250 }))
251251 defer server .Close ()
252252
@@ -267,7 +267,7 @@ func TestDownloadWithOptions_FalseUnscannable(t *testing.T) {
267267 t .Error ("Expected no allow query param when AllowUnscannable=false" )
268268 }
269269 w .WriteHeader (http .StatusOK )
270- w .Write ([]byte ("data" ))
270+ _ , _ = w .Write ([]byte ("data" ))
271271 }))
272272 defer server .Close ()
273273
@@ -284,7 +284,7 @@ func TestDownloadFromURL_StructuredErrors(t *testing.T) {
284284 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
285285 w .Header ().Set ("Content-Type" , "application/json" )
286286 w .WriteHeader (http .StatusForbidden )
287- w .Write ([]byte (`{"message":"access denied","trackingId":"track-456"}` ))
287+ _ , _ = w .Write ([]byte (`{"message":"access denied","trackingId":"track-456"}` ))
288288 }))
289289 defer server .Close ()
290290
@@ -304,12 +304,12 @@ func TestDownloadFromURLWithOptions_AllowUnscannable(t *testing.T) {
304304 server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
305305 if r .URL .Query ().Get ("allow" ) != "unscannable" {
306306 w .WriteHeader (428 )
307- w .Write ([]byte (`{"message":"unscannable"}` ))
307+ _ , _ = w .Write ([]byte (`{"message":"unscannable"}` ))
308308 return
309309 }
310310 w .Header ().Set ("Content-Type" , "application/octet-stream" )
311311 w .WriteHeader (http .StatusOK )
312- w .Write (fileData )
312+ _ , _ = w .Write (fileData )
313313 }))
314314 defer server .Close ()
315315
@@ -333,7 +333,7 @@ func TestDownload_423Locked_ReturnsLockedError(t *testing.T) {
333333 w .Header ().Set ("Content-Type" , "application/json" )
334334 w .Header ().Set ("Retry-After" , "1" )
335335 w .WriteHeader (423 )
336- w .Write ([]byte (`{"message":"file is being scanned"}` ))
336+ _ , _ = w .Write ([]byte (`{"message":"file is being scanned"}` ))
337337 }))
338338 defer server .Close ()
339339
@@ -392,13 +392,13 @@ func TestDownload_423AutoRetrySuccess(t *testing.T) {
392392 w .Header ().Set ("Content-Type" , "application/json" )
393393 w .Header ().Set ("Retry-After" , "0" )
394394 w .WriteHeader (423 )
395- w .Write ([]byte (`{"message":"file is being scanned"}` ))
395+ _ , _ = w .Write ([]byte (`{"message":"file is being scanned"}` ))
396396 return
397397 }
398398 w .Header ().Set ("Content-Type" , "text/plain" )
399399 w .Header ().Set ("Content-Disposition" , `attachment; filename="scanned.txt"` )
400400 w .WriteHeader (http .StatusOK )
401- w .Write (fileData )
401+ _ , _ = w .Write (fileData )
402402 }))
403403 defer server .Close ()
404404
@@ -426,7 +426,7 @@ func TestDownload_423RetriesExhausted(t *testing.T) {
426426 w .Header ().Set ("Content-Type" , "application/json" )
427427 w .Header ().Set ("Retry-After" , "0" )
428428 w .WriteHeader (423 )
429- w .Write ([]byte (`{"message":"file is being scanned"}` ))
429+ _ , _ = w .Write ([]byte (`{"message":"file is being scanned"}` ))
430430 }))
431431 defer server .Close ()
432432
@@ -454,12 +454,12 @@ func TestDownload_423RetryWithRetryAfterHeader(t *testing.T) {
454454 w .Header ().Set ("Content-Type" , "application/json" )
455455 w .Header ().Set ("Retry-After" , "1" )
456456 w .WriteHeader (423 )
457- w .Write ([]byte (`{"message":"scanning"}` ))
457+ _ , _ = w .Write ([]byte (`{"message":"scanning"}` ))
458458 return
459459 }
460460 w .Header ().Set ("Content-Type" , "text/plain" )
461461 w .WriteHeader (http .StatusOK )
462- w .Write (fileData )
462+ _ , _ = w .Write (fileData )
463463 }))
464464 defer server .Close ()
465465
@@ -492,13 +492,13 @@ func TestDownloadFromURL_423AutoRetrySuccess(t *testing.T) {
492492 w .Header ().Set ("Content-Type" , "application/json" )
493493 w .Header ().Set ("Retry-After" , "0" )
494494 w .WriteHeader (423 )
495- w .Write ([]byte (`{"message":"scanning"}` ))
495+ _ , _ = w .Write ([]byte (`{"message":"scanning"}` ))
496496 return
497497 }
498498 w .Header ().Set ("Content-Type" , "image/png" )
499499 w .Header ().Set ("Content-Disposition" , `attachment; filename="photo.png"` )
500500 w .WriteHeader (http .StatusOK )
501- w .Write (fileData )
501+ _ , _ = w .Write (fileData )
502502 }))
503503 defer server .Close ()
504504
@@ -527,7 +527,7 @@ func TestDownloadFromURLWithOptions_423AutoRetry(t *testing.T) {
527527 if attempts <= 2 {
528528 w .Header ().Set ("Retry-After" , "0" )
529529 w .WriteHeader (423 )
530- w .Write ([]byte (`{"message":"scanning"}` ))
530+ _ , _ = w .Write ([]byte (`{"message":"scanning"}` ))
531531 return
532532 }
533533 // Verify allow=unscannable is still present on retry
@@ -536,7 +536,7 @@ func TestDownloadFromURLWithOptions_423AutoRetry(t *testing.T) {
536536 }
537537 w .Header ().Set ("Content-Type" , "application/octet-stream" )
538538 w .WriteHeader (http .StatusOK )
539- w .Write (fileData )
539+ _ , _ = w .Write (fileData )
540540 }))
541541 defer server .Close ()
542542
@@ -563,12 +563,12 @@ func TestDownloadWithOptions_423AutoRetry(t *testing.T) {
563563 if attempts == 1 {
564564 w .Header ().Set ("Retry-After" , "0" )
565565 w .WriteHeader (423 )
566- w .Write ([]byte (`{"message":"scanning"}` ))
566+ _ , _ = w .Write ([]byte (`{"message":"scanning"}` ))
567567 return
568568 }
569569 w .Header ().Set ("Content-Type" , "application/pdf" )
570570 w .WriteHeader (http .StatusOK )
571- w .Write (fileData )
571+ _ , _ = w .Write (fileData )
572572 }))
573573 defer server .Close ()
574574
0 commit comments