@@ -29,13 +29,15 @@ func main() {
2929 t .Fatalf ("failed to create temp file: %v" , err )
3030 }
3131
32- if _ , err := tempFile .WriteString (sourceCode ); err != nil {
32+ _ , err = tempFile .WriteString (sourceCode )
33+ if err != nil {
3334 t .Fatalf ("failed to write temp file: %v" , err )
3435 }
3536 tempFile .Close ()
3637
3738 // Run the program using `go run`. By capturing the output, we ensure
3839 // that the program's stdout is not a TTY.
40+ //nolint:gosec // tempFile.Name() is a controlled temporary file created by this test
3941 cmd := exec .Command ("go" , "run" , tempFile .Name ())
4042 output , err := cmd .CombinedOutput ()
4143 if err != nil {
@@ -68,13 +70,15 @@ func main() {
6870 t .Fatalf ("failed to create temp file: %v" , err )
6971 }
7072
71- if _ , err := tempFile .WriteString (sourceCode ); err != nil {
73+ _ , err = tempFile .WriteString (sourceCode )
74+ if err != nil {
7275 t .Fatalf ("failed to write temp file: %v" , err )
7376 }
7477 tempFile .Close ()
7578
7679 // Run the program using `go run`. By capturing the output, we ensure
7780 // that the program's stdout is not a TTY.
81+ //nolint:gosec // tempFile.Name() is a controlled temporary file created by this test
7882 cmd := exec .Command ("go" , "run" , tempFile .Name ())
7983
8084 cmd .Env = append (os .Environ (), "FORCE_COLOR=1" )
0 commit comments