Skip to content

Commit a84596e

Browse files
DOC-4449 replaced slices.Sort function with older alternative
1 parent b0b62f3 commit a84596e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doctests/cmds_hash_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"context"
77
"fmt"
88
"slices"
9+
"sort"
910

1011
"github.com/redis/go-redis/v9"
1112
)
@@ -81,7 +82,7 @@ func ExampleClient_hset() {
8182
keys = append(keys, key)
8283
}
8384

84-
slices.Sort(keys)
85+
sort.Slice(keys, func(i, j int) bool { return i < j })
8586

8687
for key, _ := range res6 {
8788
fmt.Printf("Key: %v, value: %v\n", key, res6[key])
@@ -184,7 +185,7 @@ func ExampleClient_hgetall() {
184185
keys = append(keys, key)
185186
}
186187

187-
slices.Sort(keys)
188+
sort.Slice(keys, func(i, j int) bool { return i < j })
188189

189190
for key, _ := range hGetAllResult2 {
190191
fmt.Printf("Key: %v, value: %v\n", key, hGetAllResult2[key])

0 commit comments

Comments
 (0)