mirror of https://github.com/go-redis/redis.git
README Fix: Added client variable initialisation (redis.NewClient) in quickstartExampleClient() (#1257)
* updated: readme quickstart
This commit is contained in:
parent
68dd70bb72
commit
6bd8d9ce28
|
@ -56,6 +56,11 @@ func ExampleNewClient() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleClient() {
|
func ExampleClient() {
|
||||||
|
client := redis.NewClient(&redis.Options{
|
||||||
|
Addr: "localhost:6379",
|
||||||
|
Password: "", // no password set
|
||||||
|
DB: 0, // use default DB
|
||||||
|
})
|
||||||
err := client.Set("key", "value", 0).Err()
|
err := client.Set("key", "value", 0).Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue