Comments (5)
A concrete implementation is in 114787b in case this makes sense to others
from go-gh.
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 👍
from go-gh.
@mislav I ran godoc -http=:6060
on the example branch, and it renders the examples while adding the gh
package. Comparing local output for http://localhost:6060/pkg/github.com/cli/go-gh/#example_RESTClient_advanced
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?
from go-gh.
Nice, thanks for checking! Please send a PR for this 🙇
from go-gh.
done!
from go-gh.
Related Issues (20)
- Add pagination examples
- jsonpretty should not add new lines if not indenting
- TokenForHost "authentication token not found" message could be more informative HOT 3
- Feature Request: Add support to call the `gh` command interactively HOT 3
- RestClient no longer returns an HTTPError HOT 2
- Expose `ghLookupPath` or a better way to run `gh` HOT 3
- Issue while using from remote connection HOT 6
- `asciisanitizer.Sanitizer` mishandled the `�` unicode character HOT 1
- Add the ability to introduce repository specific configurations for gh-cli and its extensions HOT 2
- Create CODEOWNERS file ensuring the cli/code-reviewers are assigned to PRs
- Template support for additional functions HOT 3
- CVE Vulnerability in dependency
- Flag for printing only GraphQL information HOT 2
- @eXamadeus GitHub CLI currently has no mechanism for switching between multiple GitHub accounts and I don't really have a workaround to suggest for you at this moment, sorry. HOT 2
- Please provide fake api.GQLClient out of the box HOT 1
- TokenForHost returns string "oauth_token" as source when config is read from file
- Support for stdin and stderr in term package
- GQLCLient should return GQLError for query and mutation methods
- Add a GraphQL Mutation with an `input` object to examples HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-gh.