-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change example_gh_test.go to package gh_test
#87
Comments
A concrete implementation is in 114787b in case this makes sense to others |
Thanks for bringing this up. Will the examples still get rendered of on the main page of generated docs? If so, I'm in favor of this 👍 |
@mislav I ran From trunk: opts := api.ClientOptions{
Host: "github.com",
AuthToken: "xxxxxxxxxx", // Replace with valid auth token.
Headers: map[string]string{"Time-Zone": "America/Los_Angeles"},
Log: os.Stdout,
}
client, err := RESTClient(&opts)
if err != nil {
log.Fatal(err)
}
response := []struct{ Name string }{}
err = client.Get("repos/cli/cli/tags", &response)
if err != nil {
log.Fatal(err)
}
fmt.Println(response) From the example branch: opts := api.ClientOptions{
Host: "github.com",
AuthToken: "xxxxxxxxxx", // Replace with valid auth token.
Headers: map[string]string{"Time-Zone": "America/Los_Angeles"},
Log: os.Stdout,
}
client, err := gh.RESTClient(&opts)
if err != nil {
log.Fatal(err)
}
response := []struct{ Name string }{}
err = client.Get("repos/cli/cli/tags", &response)
if err != nil {
log.Fatal(err)
}
fmt.Println(response) is there something else I should check for? |
Nice, thanks for checking! Please send a PR for this 🙇 |
done! |
Being in the same package, the example test file can refer to functions such as
RESTClient
andExec
as local, as opposed togh.RESTClient
andgh.Exec
. This presents some challenges:I would like to suggest changing the package of the example file and updating the functions in it.
The text was updated successfully, but these errors were encountered: