()
| 613 | } |
| 614 | |
| 615 | func Example_customCommand() { |
| 616 | Get := func(ctx context.Context, rdb *redis.Client, key string) *redis.StringCmd { |
| 617 | cmd := redis.NewStringCmd(ctx, "get", key) |
| 618 | rdb.Process(ctx, cmd) |
| 619 | return cmd |
| 620 | } |
| 621 | |
| 622 | v, err := Get(ctx, rdb, "key_does_not_exist").Result() |
| 623 | fmt.Printf("%q %s", v, err) |
| 624 | // Output: "" redis: nil |
| 625 | } |
| 626 | |
| 627 | func Example_customCommand2() { |
| 628 | v, err := rdb.Do(ctx, "get", "key_does_not_exist").Text() |