mirror of
https://github.com/redis/go-redis.git
synced 2025-12-03 18:31:14 +03:00
Merge branch 'master' into ndyakov/state-machine-conn
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user