1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-02 06:22:31 +03:00

Merge branch 'master' into ndyakov/state-machine-conn

This commit is contained in:
Nedyalko Dyakov
2025-10-25 03:33:17 +03:00
committed by GitHub
4 changed files with 6 additions and 13 deletions

View File

@@ -79,7 +79,7 @@ func ExampleClient_hset() {
keys := make([]string, 0, len(res6)) keys := make([]string, 0, len(res6))
for key, _ := range res6 { for key := range res6 {
keys = append(keys, key) keys = append(keys, key)
} }
@@ -186,7 +186,7 @@ func ExampleClient_hgetall() {
keys := make([]string, 0, len(hGetAllResult2)) keys := make([]string, 0, len(hGetAllResult2))
for key, _ := range hGetAllResult2 { for key := range hGetAllResult2 {
keys = append(keys, key) keys = append(keys, key)
} }

View File

@@ -86,7 +86,7 @@ func benchmarkHSETOperations(b *testing.B, rdb *redis.Client, ctx context.Contex
b.Fatalf("HSET operation failed: %v", err) 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 // Stop the timer to calculate metrics
@@ -164,7 +164,7 @@ func benchmarkHSETPipelined(b *testing.B, rdb *redis.Client, ctx context.Context
if err != nil { if err != nil {
b.Fatalf("Pipeline execution failed: %v", err) b.Fatalf("Pipeline execution failed: %v", err)
} }
totalTimes = append(totalTimes, time.Now().Sub(startTime)) totalTimes = append(totalTimes, time.Since(startTime))
} }
b.StopTimer() b.StopTimer()

View File

@@ -43,13 +43,6 @@ func containsSubstring(s, substr string) bool {
return false 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{}) { func printLog(group string, isError bool, format string, args ...interface{}) {
_, filename, line, _ := runtime.Caller(2) _, filename, line, _ := runtime.Caller(2)
filename = filepath.Base(filename) filename = filepath.Base(filename)

View File

@@ -144,7 +144,7 @@ func TestRegistry(t *testing.T) {
t.Run("NewRegistry", func(t *testing.T) { t.Run("NewRegistry", func(t *testing.T) {
registry := NewRegistry() registry := NewRegistry()
if registry == nil { if registry == nil {
t.Error("NewRegistry should not return nil") t.Fatal("NewRegistry should not return nil")
} }
if registry.handlers == nil { if registry.handlers == nil {
@@ -407,7 +407,7 @@ func TestProcessor(t *testing.T) {
t.Run("NewProcessor", func(t *testing.T) { t.Run("NewProcessor", func(t *testing.T) {
processor := NewProcessor() processor := NewProcessor()
if processor == nil { if processor == nil {
t.Error("NewProcessor should not return nil") t.Fatal("NewProcessor should not return nil")
} }
if processor.registry == nil { if processor.registry == nil {