Skip to content

Commit 82f2c28

Browse files
DOC-4449 try sort.Strings() for sorting key lists
1 parent 113618c commit 82f2c28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doctests/cmds_hash_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func ExampleClient_hset() {
8181
keys = append(keys, key)
8282
}
8383

84-
sort.Slice(keys, func(i, j int) bool { return i < j })
84+
sort.Strings(keys)
8585

8686
for _, key := range keys {
8787
fmt.Printf("Key: %v, value: %v\n", key, res6[key])
@@ -184,7 +184,7 @@ func ExampleClient_hgetall() {
184184
keys = append(keys, key)
185185
}
186186

187-
sort.Slice(keys, func(i, j int) bool { return i < j })
187+
sort.Strings(keys)
188188

189189
for _, key := range keys {
190190
fmt.Printf("Key: %v, value: %v\n", key, hGetAllResult2[key])
@@ -230,7 +230,7 @@ func ExampleClient_hvals() {
230230
panic(err)
231231
}
232232

233-
sort.Slice(hValsResult2, func(i, j int) bool { return i < j })
233+
sort.Strings(hValsResult2)
234234

235235
fmt.Println(hValsResult2) // >>> [Hello World]
236236
// STEP_END

0 commit comments

Comments
 (0)