@@ -53,28 +53,28 @@ func TestSupportsColor(t *testing.T) {
5353 originalForceColor := os .Getenv ("FORCE_COLOR" )
5454
5555 // Test NO_COLOR set
56- os .Setenv ("NO_COLOR" , "1" )
56+ _ = os .Setenv ("NO_COLOR" , "1" )
5757 if supportsColor () {
5858 t .Error ("Expected supportsColor to return false when NO_COLOR is set" )
5959 }
6060
6161 // Test FORCE_COLOR set
62- os .Unsetenv ("NO_COLOR" )
63- os .Setenv ("FORCE_COLOR" , "1" )
62+ _ = os .Unsetenv ("NO_COLOR" )
63+ _ = os .Setenv ("FORCE_COLOR" , "1" )
6464 if ! supportsColor () {
6565 t .Error ("Expected supportsColor to return true when FORCE_COLOR is set" )
6666 }
6767
6868 // Restore original environment
6969 if originalNoColor == "" {
70- os .Unsetenv ("NO_COLOR" )
70+ _ = os .Unsetenv ("NO_COLOR" )
7171 } else {
72- os .Setenv ("NO_COLOR" , originalNoColor )
72+ _ = os .Setenv ("NO_COLOR" , originalNoColor )
7373 }
7474 if originalForceColor == "" {
75- os .Unsetenv ("FORCE_COLOR" )
75+ _ = os .Unsetenv ("FORCE_COLOR" )
7676 } else {
77- os .Setenv ("FORCE_COLOR" , originalForceColor )
77+ _ = os .Setenv ("FORCE_COLOR" , originalForceColor )
7878 }
7979}
8080
@@ -182,8 +182,8 @@ func TestGetStoredMessages(t *testing.T) {
182182 // Verify it's a copy (modifying returned slice shouldn't affect original)
183183 if len (messages ) > 0 {
184184 messages [0 ].Message = "modified"
185- originalMessages := GetStoredMessages ()
186- if originalMessages [0 ].Message == "modified" {
185+ om := GetStoredMessages ()
186+ if om [0 ].Message == "modified" {
187187 t .Error ("GetStoredMessages should return a copy, not the original slice" )
188188 }
189189 }
@@ -234,7 +234,7 @@ func TestNewProgressBar(t *testing.T) {
234234
235235func TestProgressBar_Update (t * testing.T ) {
236236 pb := NewProgressBar (100 , "Test" )
237-
237+
238238 // Set quiet mode to avoid output during test
239239 originalQuiet := quietMode
240240 quietMode = true
@@ -253,7 +253,7 @@ func TestProgressBar_Update(t *testing.T) {
253253
254254func TestProgressBar_SetSuffix (t * testing.T ) {
255255 pb := NewProgressBar (100 , "Test" )
256-
256+
257257 // Set quiet mode to avoid output during test
258258 originalQuiet := quietMode
259259 quietMode = true
@@ -268,7 +268,7 @@ func TestProgressBar_SetSuffix(t *testing.T) {
268268
269269func TestProgressBar_SetLoading (t * testing.T ) {
270270 pb := NewProgressBar (100 , "Test" )
271-
271+
272272 // Set quiet mode to avoid output during test
273273 originalQuiet := quietMode
274274 quietMode = true
@@ -287,7 +287,7 @@ func TestProgressBar_SetLoading(t *testing.T) {
287287
288288func TestProgressBar_SetThinking (t * testing.T ) {
289289 pb := NewProgressBar (100 , "Test" )
290-
290+
291291 // Set quiet mode to avoid output during test
292292 originalQuiet := quietMode
293293 quietMode = true
@@ -306,7 +306,7 @@ func TestProgressBar_SetThinking(t *testing.T) {
306306
307307func TestProgressBar_SetSending (t * testing.T ) {
308308 pb := NewProgressBar (100 , "Test" )
309-
309+
310310 // Set quiet mode to avoid output during test
311311 originalQuiet := quietMode
312312 quietMode = true
@@ -325,7 +325,7 @@ func TestProgressBar_SetSending(t *testing.T) {
325325
326326func TestProgressBar_AddMessage (t * testing.T ) {
327327 pb := NewProgressBar (100 , "Test" )
328-
328+
329329 // Set quiet mode to avoid output during test
330330 originalQuiet := quietMode
331331 quietMode = true
@@ -348,7 +348,7 @@ func TestProgressBar_AddMessage(t *testing.T) {
348348
349349func TestProgressBar_ThreadSafety (t * testing.T ) {
350350 pb := NewProgressBar (1000 , "Test" )
351-
351+
352352 // Set quiet mode to avoid output during test
353353 originalQuiet := quietMode
354354 quietMode = true
@@ -377,8 +377,10 @@ func TestSaveLogsToFile(t *testing.T) {
377377 if err != nil {
378378 t .Fatal (err )
379379 }
380- tempFile .Close ()
381- defer os .Remove (tempFile .Name ())
380+ _ = tempFile .Close ()
381+ defer func () {
382+ _ = os .Remove (tempFile .Name ())
383+ }()
382384
383385 // Store some test messages
384386 logMutex .Lock ()
@@ -443,7 +445,7 @@ func TestConstants(t *testing.T) {
443445func TestLoggingFunctionsQuietMode (t * testing.T ) {
444446 // Save original state
445447 originalQuiet := quietMode
446-
448+
447449 // Clear existing messages and enable quiet mode
448450 logMutex .Lock ()
449451 originalMessages := logMessages
@@ -475,7 +477,7 @@ func TestLoggingFunctionsQuietMode(t *testing.T) {
475477func TestLoggingFunctionsNormalMode (t * testing.T ) {
476478 // Save original state
477479 originalQuiet := quietMode
478-
480+
479481 // Clear existing messages
480482 logMutex .Lock ()
481483 originalMessages := logMessages
@@ -486,7 +488,7 @@ func TestLoggingFunctionsNormalMode(t *testing.T) {
486488
487489 // Call logging functions
488490 Info ("test info" )
489- Warning ("test warning" )
491+ Warning ("test warning" )
490492 Error ("test error" )
491493 Success ("test success" )
492494 Highlight ("test highlight" )
@@ -524,4 +526,4 @@ func TestLoggingFunctionsNormalMode(t *testing.T) {
524526 logMutex .Lock ()
525527 logMessages = originalMessages
526528 logMutex .Unlock ()
527- }
529+ }
0 commit comments