Skip to content

Commit 44aaf0e

Browse files
committed
[fix] changes per review
1 parent bd40ed9 commit 44aaf0e

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,10 @@ all: test coverage examples
1313
get:
1414
$(GOGET) -t -v ./...
1515

16-
TLS_CERT ?= redis.crt
17-
TLS_KEY ?= redis.key
18-
TLS_CACERT ?= ca.crt
19-
REDISGRAPH_TEST_HOST ?= 127.0.0.1:6379
20-
2116
examples: get
2217
@echo " "
2318
@echo "Building the examples..."
2419
$(GOBUILD) ./examples/redisgraph_tls_client/.
25-
./redisgraph_tls_client --tls-cert-file $(TLS_CERT) \
26-
--tls-key-file $(TLS_KEY) \
27-
--tls-ca-cert-file $(TLS_CACERT) \
28-
--host $(REDISGRAPH_TEST_HOST)
2920

3021
test: get
3122
$(GOTEST) -race -covermode=atomic ./...

example_graph_test.go

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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() {
119109
func 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

Comments
 (0)