forked from mirror/redis
Update examples.
This commit is contained in:
parent
de7a9d3142
commit
4c504ab528
|
@ -16,8 +16,8 @@ func ExampleNewTCPClient() {
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
ping := client.Ping()
|
ping := client.Ping()
|
||||||
fmt.Println(ping.Err(), ping.Val())
|
fmt.Println(ping.Val(), ping.Err())
|
||||||
// Output: <nil> PONG
|
// Output: PONG <nil>
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleNewUnixClient() {
|
func ExampleNewUnixClient() {
|
||||||
|
@ -27,8 +27,8 @@ func ExampleNewUnixClient() {
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
ping := client.Ping()
|
ping := client.Ping()
|
||||||
fmt.Println(ping.Err(), ping.Val())
|
fmt.Println(ping.Val(), ping.Err())
|
||||||
// Output: <nil> PONG
|
// Output: PONG <nil>
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleClient() {
|
func ExampleClient() {
|
||||||
|
@ -114,11 +114,11 @@ func ExampleMulti() {
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
fmt.Println(err, cmds)
|
fmt.Println(cmds, err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output: <nil> [SET key 1: OK]
|
// Output: [SET key 1: OK] <nil>
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExamplePubSub() {
|
func ExamplePubSub() {
|
||||||
|
@ -159,6 +159,6 @@ func Example_customCommand() {
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
get := Get(client, "key_does_not_exist")
|
get := Get(client, "key_does_not_exist")
|
||||||
fmt.Println(get.Err(), get.Val())
|
fmt.Printf("%q %s", get.Val(), get.Err())
|
||||||
// Output: (nil)
|
// Output: "" (nil)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue