@@ -16,12 +16,9 @@ func ExampleGraphNew() {
1616
1717 graph := redisgraph .GraphNew ("social" , conn )
1818
19- q := "CREATE (w:WorkPlace {name:'RedisLabs'})"
19+ q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w "
2020 res , _ := graph .Query (q )
2121
22- q = "MATCH (w:WorkPlace) RETURN w"
23- res , _ = graph .Query (q )
24-
2522 res .Next ()
2623 r := res .Record ()
2724 w := r .GetByIndex (0 ).(* redisgraph.Node )
@@ -38,12 +35,9 @@ func ExampleGraphNew_pool() {
3835
3936 graph := redisgraph .GraphNew ("social" , pool .Get ())
4037
41- q := "CREATE (w:WorkPlace {name:'RedisLabs'})"
38+ q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w "
4239 res , _ := graph .Query (q )
4340
44- q = "MATCH (w:WorkPlace) RETURN w"
45- res , _ = graph .Query (q )
46-
4741 res .Next ()
4842 r := res .Record ()
4943 w := r .GetByIndex (0 ).(* redisgraph.Node )
@@ -104,13 +98,9 @@ func ExampleGraphNew_tls() {
10498
10599 graph := redisgraph .GraphNew ("social" , pool .Get ())
106100
107- q := "CREATE (w:WorkPlace {name:'RedisLabs'})"
108- res , err := graph .Query (q )
109-
110- q = "MATCH (w:WorkPlace) RETURN w"
111- res , err = graph .Query (q )
101+ q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w"
102+ res , _ := graph .Query (q )
112103
113- res .Next ()
114104 r := res .Record ()
115105 w := r .GetByIndex (0 ).(* redisgraph.Node )
116106 fmt .Println (w .Label )
@@ -119,11 +109,11 @@ func ExampleGraphNew_tls() {
119109func getConnectionDetails () (host string , password string ) {
120110 value , exists := os .LookupEnv ("REDISGRAPH_TEST_HOST" )
121111 host = "localhost:6379"
122- password = ""
123- valuePassword , existsPassword := os .LookupEnv ("REDISGRAPH_TEST_PASSWORD" )
124112 if exists && value != "" {
125113 host = value
126114 }
115+ password = ""
116+ valuePassword , existsPassword := os .LookupEnv ("REDISGRAPH_TEST_PASSWORD" )
127117 if existsPassword && valuePassword != "" {
128118 password = valuePassword
129119 }
0 commit comments