mirror of
https://github.com/redis/go-redis.git
synced 2025-04-19 07:22:17 +03:00
DOC-4799 fixed capped list example (#3260)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
This commit is contained in:
parent
3cef280602
commit
86bb1433ca
@ -388,7 +388,7 @@ func ExampleClient_ltrim() {
|
|||||||
// REMOVE_END
|
// REMOVE_END
|
||||||
|
|
||||||
// STEP_START ltrim
|
// STEP_START ltrim
|
||||||
res27, err := rdb.LPush(ctx, "bikes:repairs", "bike:1", "bike:2", "bike:3", "bike:4", "bike:5").Result()
|
res27, err := rdb.RPush(ctx, "bikes:repairs", "bike:1", "bike:2", "bike:3", "bike:4", "bike:5").Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -410,13 +410,13 @@ func ExampleClient_ltrim() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(res29) // >>> [bike:5 bike:4 bike:3]
|
fmt.Println(res29) // >>> [bike:1 bike:2 bike:3]
|
||||||
// STEP_END
|
// STEP_END
|
||||||
|
|
||||||
// Output:
|
// Output:
|
||||||
// 5
|
// 5
|
||||||
// OK
|
// OK
|
||||||
// [bike:5 bike:4 bike:3]
|
// [bike:1 bike:2 bike:3]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleClient_ltrim_end_of_list() {
|
func ExampleClient_ltrim_end_of_list() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user