1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00
This commit is contained in:
Vladimir Mihailenco
2018-08-06 13:59:15 +03:00
parent 464daeb271
commit 96d1b85009
8 changed files with 61 additions and 39 deletions

View File

@ -140,16 +140,16 @@ func ExampleClient() {
}
fmt.Println("key", val)
val2, err := client.Get("key2").Result()
val2, err := client.Get("missing_key").Result()
if err == redis.Nil {
fmt.Println("key2 does not exist")
fmt.Println("missing_key does not exist")
} else if err != nil {
panic(err)
} else {
fmt.Println("key2", val2)
fmt.Println("missing_key", val2)
}
// Output: key value
// key2 does not exist
// missing_key does not exist
}
func ExampleClient_Set() {