Skip to content

Commit

Permalink
update go example in readme (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsmith7741 authored Jan 22, 2024
1 parent dd28761 commit abb7ec0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,21 @@ var pickles = Gherkin.compile(gherkinDocument, 'uri_of_the_feature.feature', uui

```go
// Go
// Download the package via: `go get github.com/cucumber/cucumber/gherkin/go`
// Download the package via: `go get github.com/cucumber/gherkin/go/v27`
// && go get "github.com/cucumber/messages/go/v22"
import (
"strings"
gherkin "github.com/cucumber/cucumber/gherkin/go"

gherkin "github.com/cucumber/gherkin/go/v27"
messages "github.com/cucumber/messages/go/v22"
)
reader := strings.NewReader(`Feature: ...`)
gherkinDocument, err := gherkin.ParseGherkinDocument(reader)

func main() {
uuid := &message.UUID{} // or &message.Incrementing{}
reader := strings.NewReader(`Feature: ...`)
gherkinDocument, err := gherkin.ParseGherkinDocument(reader, uuid.NewId)
pickles := gherkin.Pickles(*gherkinDocument, "minimal.feature", uuid.NewId)
}
```

```python
Expand Down

0 comments on commit abb7ec0

Please sign in to comment.