README Fix: Added client variable initialisation (redis.NewClient) in quickstartExampleClient() (#1257)

* updated: readme quickstart
This commit is contained in:
Sawit Trisirisatayawong 2020-02-11 14:35:26 +07:00 committed by GitHub
parent 68dd70bb72
commit 6bd8d9ce28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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)