Explorar el Código

Add Dial example.

Gary Burd hace 13 años
padre
commit
f885f172c9
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  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)
 	}
 }
+
+// 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()
+
+}