File tree 1 file changed +3
-11
lines changed
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,12 @@ import (
21
21
"fmt"
22
22
"log"
23
23
24
- "github.com/dgraph-io/dgo/v2"
25
24
"github.com/dgraph-io/dgo/v2/protos/api"
26
- "google.golang.org/grpc"
27
25
)
28
26
29
27
func Example_getSchema () {
30
- conn , err := grpc .Dial ("127.0.0.1:9180" , grpc .WithInsecure ())
31
- if err != nil {
32
- log .Fatal ("While trying to dial gRPC" )
33
- }
34
- defer conn .Close ()
35
-
36
- dc := api .NewDgraphClient (conn )
37
- dg := dgo .NewDgraphClient (dc )
28
+ dg , cancel := getDgraphClient ()
29
+ defer cancel ()
38
30
39
31
op := & api.Operation {}
40
32
op .Schema = `
@@ -46,7 +38,7 @@ func Example_getSchema() {
46
38
`
47
39
48
40
ctx := context .Background ()
49
- err = dg .Alter (ctx , op )
41
+ err : = dg .Alter (ctx , op )
50
42
if err != nil {
51
43
log .Fatal (err )
52
44
}
You can’t perform that action at this time.
0 commit comments