diff --git a/doctests/cmds_hash_test.go b/doctests/cmds_hash_test.go index 8a4fdec4..7241bca4 100644 --- a/doctests/cmds_hash_test.go +++ b/doctests/cmds_hash_test.go @@ -79,7 +79,7 @@ func ExampleClient_hset() { keys := make([]string, 0, len(res6)) - for key, _ := range res6 { + for key := range res6 { keys = append(keys, key) } @@ -186,7 +186,7 @@ func ExampleClient_hgetall() { keys := make([]string, 0, len(hGetAllResult2)) - for key, _ := range hGetAllResult2 { + for key := range hGetAllResult2 { keys = append(keys, key) } diff --git a/hset_benchmark_test.go b/hset_benchmark_test.go index df163435..8d141f41 100644 --- a/hset_benchmark_test.go +++ b/hset_benchmark_test.go @@ -86,7 +86,7 @@ func benchmarkHSETOperations(b *testing.B, rdb *redis.Client, ctx context.Contex b.Fatalf("HSET operation failed: %v", err) } } - totalTimes = append(totalTimes, time.Now().Sub(startTime)) + totalTimes = append(totalTimes, time.Since(startTime)) } // Stop the timer to calculate metrics @@ -164,7 +164,7 @@ func benchmarkHSETPipelined(b *testing.B, rdb *redis.Client, ctx context.Context if err != nil { b.Fatalf("Pipeline execution failed: %v", err) } - totalTimes = append(totalTimes, time.Now().Sub(startTime)) + totalTimes = append(totalTimes, time.Since(startTime)) } b.StopTimer() diff --git a/maintnotifications/e2e/utils_test.go b/maintnotifications/e2e/utils_test.go index a60fac89..0aef84de 100644 --- a/maintnotifications/e2e/utils_test.go +++ b/maintnotifications/e2e/utils_test.go @@ -43,13 +43,6 @@ func containsSubstring(s, substr string) bool { return false } -func min(a, b int) int { - if a < b { - return a - } - return b -} - func printLog(group string, isError bool, format string, args ...interface{}) { _, filename, line, _ := runtime.Caller(2) filename = filepath.Base(filename) diff --git a/push/push_test.go b/push/push_test.go index 69126f30..b98b5f16 100644 --- a/push/push_test.go +++ b/push/push_test.go @@ -144,7 +144,7 @@ func TestRegistry(t *testing.T) { t.Run("NewRegistry", func(t *testing.T) { registry := NewRegistry() if registry == nil { - t.Error("NewRegistry should not return nil") + t.Fatal("NewRegistry should not return nil") } if registry.handlers == nil { @@ -407,7 +407,7 @@ func TestProcessor(t *testing.T) { t.Run("NewProcessor", func(t *testing.T) { processor := NewProcessor() if processor == nil { - t.Error("NewProcessor should not return nil") + t.Fatal("NewProcessor should not return nil") } if processor.registry == nil {