docs: add WithApplication and action waiting to code example #808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code example in our README.md only contained a minimal example showing how to set up the client and make a simple GET request.
This introduces two additional "features" to the example:
We sometimes get support requests from users who forget to wait for the returned actions and expect the server (or other resource) to be immediately ready.
We regularly get support requests from users where the rate limit is exhausted by tools that do not identify themselves. This makes it hard to help users, as we are missing information.
By showing the best-practices for both of these cases in the example, I hope that more people adopt them and have a better experience overall.
Additionally I added the example to the go package docs for
hcloud, so it also shows up on pkgs.go.dev for the package.