Browse Source

Add Dial example.

Gary Burd 13 years ago
parent
commit
f885f172c9
1 changed files with 10 additions and 0 deletions
  1. 10 0
      redis/conn_test.go

+ 10 - 0
redis/conn_test.go

@@ -303,3 +303,13 @@ func TestError(t *testing.T) {
 		t.Errorf("Do(SET, key, val) returned error %v, expected nil.", err)
 		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()
+
+}