Skip to content

Commit

Permalink
docs: improve onboarding
Browse files Browse the repository at this point in the history
When getting started with go sdk it's easy to miss waiting for initialization. This change will make it easy for newcomers to use the SDK and more advanced users should be able to wait for the readiness in different ways if they don't want to block the main thread
  • Loading branch information
gastonfournier authored Nov 20, 2023
1 parent 07d99cb commit 7c9736c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func init() {
unleash.WithUrl("http://unleash.herokuapp.com/api/"),
unleash.WithCustomHeaders(http.Header{"Authorization": {"<API token>"}}),
)

// The line below will block until the default client is ready or returns immediately. You can wait for readiness in a different way but this is good for new joiners
unleash.WaitForReady()
}
```

Expand Down

0 comments on commit 7c9736c

Please sign in to comment.