cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Support for paginating API responses? #22

Closed lox closed 2 years ago

lox commented 2 years ago

I'm using this for getting changed files between two commits, I presume this will split across pages, is there a way using the HTTPClient to get at the Link headers?

samcoe commented 2 years ago

@lox The HTTPClient function returns a standard Go http.Client instance so after making a request the client will return a http.Response that you can inspect the headers of using the Header field. Does that answer your question?

lox commented 2 years ago

Yes, it does. I was actually using the RESTClient!