From 559b2b27a7739a71a3ca29f8bf5d94995807e9f0 Mon Sep 17 00:00:00 2001 From: jahfer Date: Sat, 19 Jan 2013 11:31:23 -0500 Subject: [PATCH] Fixed syntax in "Getting started" example Now correctly demonstrates how to do error-handling on a "client.set()" command --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fbb58be..7fd1bdf 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,15 @@ Let's start with connecting to Redis: 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") - if err := get.Err(); err != nil { panic(err) } + if err := get.Err(); err != nil { + panic(err) + } fmt.Println(get.Val()) We can also pipeline two commands together: