@@ -275,7 +275,11 @@ func TestPdfPageCount_ValidPDF(t *testing.T) {
275275
276276 tmpDir := t .TempDir ()
277277 pdfPath := filepath .Join (tmpDir , "input.pdf" )
278- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
278+ //nolint:gosec // path is tmpDir + constant filename
279+ require .NoError (
280+ t ,
281+ os .WriteFile (pdfPath , data , 0o600 ),
282+ )
279283
280284 count , err := pdfPageCount (context .Background (), pdfPath )
281285 require .NoError (t , err )
@@ -290,7 +294,11 @@ func TestPdfPageCount_InvalidPDF(t *testing.T) {
290294
291295 tmpDir := t .TempDir ()
292296 pdfPath := filepath .Join (tmpDir , "corrupt.pdf" )
293- require .NoError (t , os .WriteFile (pdfPath , []byte ("corrupt data" ), 0o600 ))
297+ //nolint:gosec // path is tmpDir + constant filename
298+ require .NoError (
299+ t ,
300+ os .WriteFile (pdfPath , []byte ("corrupt data" ), 0o600 ),
301+ )
294302
295303 _ , err := pdfPageCount (context .Background (), pdfPath )
296304 assert .Error (t , err )
@@ -309,7 +317,11 @@ func TestPdfPageCount_ContextCancelled(t *testing.T) {
309317
310318 tmpDir := t .TempDir ()
311319 pdfPath := filepath .Join (tmpDir , "input.pdf" )
312- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
320+ //nolint:gosec // path is tmpDir + constant filename
321+ require .NoError (
322+ t ,
323+ os .WriteFile (pdfPath , data , 0o600 ),
324+ )
313325
314326 ctx , cancel := context .WithCancel (context .Background ())
315327 cancel ()
@@ -335,7 +347,11 @@ func TestOcrPage_ValidPDF(t *testing.T) {
335347
336348 tmpDir := t .TempDir ()
337349 pdfPath := filepath .Join (tmpDir , "input.pdf" )
338- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
350+ //nolint:gosec // path is tmpDir + constant filename
351+ require .NoError (
352+ t ,
353+ os .WriteFile (pdfPath , data , 0o600 ),
354+ )
339355
340356 result := ocrPage (context .Background (), pdfPath , 1 , nil )
341357 require .NoError (t , result .err )
@@ -351,7 +367,11 @@ func TestOcrPage_InvalidPDF(t *testing.T) {
351367
352368 tmpDir := t .TempDir ()
353369 pdfPath := filepath .Join (tmpDir , "corrupt.pdf" )
354- require .NoError (t , os .WriteFile (pdfPath , []byte ("corrupt data" ), 0o600 ))
370+ //nolint:gosec // path is tmpDir + constant filename
371+ require .NoError (
372+ t ,
373+ os .WriteFile (pdfPath , []byte ("corrupt data" ), 0o600 ),
374+ )
355375
356376 result := ocrPage (context .Background (), pdfPath , 1 , nil )
357377 assert .Error (t , result .err )
@@ -370,7 +390,11 @@ func TestOcrPage_ContextCancelled(t *testing.T) {
370390
371391 tmpDir := t .TempDir ()
372392 pdfPath := filepath .Join (tmpDir , "input.pdf" )
373- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
393+ //nolint:gosec // path is tmpDir + constant filename
394+ require .NoError (
395+ t ,
396+ os .WriteFile (pdfPath , data , 0o600 ),
397+ )
374398
375399 ctx , cancel := context .WithCancel (context .Background ())
376400 cancel ()
@@ -812,7 +836,11 @@ func TestOcrPDFPages_ValidPDF(t *testing.T) {
812836
813837 tmpDir := t .TempDir ()
814838 pdfPath := filepath .Join (tmpDir , "input.pdf" )
815- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
839+ //nolint:gosec // path is tmpDir + constant filename
840+ require .NoError (
841+ t ,
842+ os .WriteFile (pdfPath , data , 0o600 ),
843+ )
816844
817845 pageCount , err := pdfPageCount (context .Background (), pdfPath )
818846 require .NoError (t , err )
@@ -844,7 +872,11 @@ func TestOcrPDFPages_ContextCancelled(t *testing.T) {
844872
845873 tmpDir := t .TempDir ()
846874 pdfPath := filepath .Join (tmpDir , "input.pdf" )
847- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
875+ //nolint:gosec // path is tmpDir + constant filename
876+ require .NoError (
877+ t ,
878+ os .WriteFile (pdfPath , data , 0o600 ),
879+ )
848880
849881 ctx , cancel := context .WithCancel (context .Background ())
850882 cancel ()
@@ -867,7 +899,11 @@ func TestOcrPDFPages_ProgressReporting(t *testing.T) {
867899
868900 tmpDir := t .TempDir ()
869901 pdfPath := filepath .Join (tmpDir , "input.pdf" )
870- require .NoError (t , os .WriteFile (pdfPath , data , 0o600 ))
902+ //nolint:gosec // path is tmpDir + constant filename
903+ require .NoError (
904+ t ,
905+ os .WriteFile (pdfPath , data , 0o600 ),
906+ )
871907
872908 pageDone := make (chan struct {}, 2 )
873909 results := ocrPDFPages (context .Background (), pdfPath , 1 , nil , pageDone )
0 commit comments