|
|
@@ -303,3 +303,13 @@ func TestError(t *testing.T) {
|
|
|
t.Errorf("Do(SET, key, val) returned error %v, expected nil.", err)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// Connect to local instance of Redis running on the default port.
|
|
|
+func ExampleDial(x int) {
|
|
|
+ c, err := redis.Dial("tcp", ":6379")
|
|
|
+ if err != nil {
|
|
|
+ // handle error
|
|
|
+ }
|
|
|
+ defer c.Close()
|
|
|
+
|
|
|
+}
|