Skip to content

Commit

Permalink
fixed comment for Iterate() (#81)
Browse files Browse the repository at this point in the history
fixed comment for Iterate()
  • Loading branch information
vkagamlyk authored Apr 21, 2022
1 parent 67db228 commit 26d6dee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
29 changes: 9 additions & 20 deletions gremlin-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,11 @@ func main() {
g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)

// Add a vertex with properties to the graph with the terminal step Iterate()
_, promise, err := g.AddV("gremlin").Property("language", "go").Iterate()
if err != nil {
fmt.Println(err)
return
}
promise := g.AddV("gremlin").Property("language", "go").Iterate()

// The returned promised is a go channel to wait for all submitted steps to finish execution and return error.
if <-promise != nil {
err := <-promise
if err != nil {
fmt.Println(err)
return
}
Expand Down Expand Up @@ -286,14 +283,10 @@ Gremlin variant for that language.
### Create Vertex
Adding a vertex with properties.
```go
_, promise, err := g.AddV("gremlin").Property("language", "go").Iterate()
// Handle error
if err != nil {
fmt.Println(err)
return
}
promise := g.AddV("gremlin").Property("language", "go").Iterate()
// Wait for all steps to finish execution and check for error.
if <-promise != nil {
err := <-promise
if err != nil {
fmt.Println(err)
return
}
Expand All @@ -316,14 +309,10 @@ for _, r := range result {
### Update Vertex
Updating vertex by adding another property to it.
```go
_, promise, err :=g.AddV("gremlin").Property("language", "go").Iterate()
// Handle error
if err != nil {
fmt.Println(err)
return
}
promise := g.AddV("gremlin").Property("language", "go").Iterate()
// Wait for all steps to finish execution and check for error.
if <-promise != nil {
err := <-promise
if err != nil {
fmt.Println(err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion gremlin-go/driver/traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (t *Traversal) ToSet() (map[*Result]bool, error) {
return set, nil
}

// Iterate all the Traverser instances in the traversal and returns the empty traversal.
// Iterate all the Traverser instances in the traversal.
func (t *Traversal) Iterate() <-chan error {
r := make(chan error)

Expand Down

0 comments on commit 26d6dee

Please sign in to comment.