forked from mirror/redis
Fixed syntax in "Getting started" example
Now correctly demonstrates how to do error-handling on a "client.set()" command
This commit is contained in:
parent
4ef326c3ab
commit
559b2b27a7
|
@ -32,10 +32,15 @@ Let's start with connecting to Redis:
|
||||||
|
|
||||||
Then we can start sending commands:
|
Then we can start sending commands:
|
||||||
|
|
||||||
if err := client.Set("foo", "bar"); err != nil { panic(err) }
|
set := client.Set("foo", "bar");
|
||||||
|
if err := set.Err(); err != nil {
|
||||||
|
panic(set.Err())
|
||||||
|
}
|
||||||
|
|
||||||
get := client.Get("foo")
|
get := client.Get("foo")
|
||||||
if err := get.Err(); err != nil { panic(err) }
|
if err := get.Err(); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
fmt.Println(get.Val())
|
fmt.Println(get.Val())
|
||||||
|
|
||||||
We can also pipeline two commands together:
|
We can also pipeline two commands together:
|
||||||
|
|
Loading…
Reference in New Issue