@@ -31,27 +31,27 @@ The services of a client divide the API into logical chunks and correspond to
3131the structure of the GitHub API documentation at
3232https://docs.github.com/rest .
3333
34- NOTE: Using the https://pkg.go.dev/ context package, one can easily
34+ NOTE: Using the [ context] package, one can easily
3535pass cancelation signals and deadlines to various services of the client for
36- handling a request. In case there is no context available, then context.Background()
36+ handling a request. In case there is no context available, then [ context.Background]
3737can be used as a starting point.
3838
3939For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory.
4040
4141# Authentication
4242
43- Use Client.WithAuthToken to configure your client to authenticate using an Oauth token
43+ Use [ Client.WithAuthToken] to configure your client to authenticate using an Oauth token
4444(for example, a personal access token). This is what is needed for a majority of use cases
4545aside from GitHub Apps.
4646
4747 client := github.NewClient(nil).WithAuthToken("... your access token ...")
4848
49- Note that when using an authenticated Client, all calls made by the client will
49+ Note that when using an authenticated [ Client] , all calls made by the client will
5050include the specified OAuth token. Therefore, authenticated clients should
5151almost never be shared between different users.
5252
5353For API methods that require HTTP Basic Authentication, use the
54- BasicAuthTransport.
54+ [ BasicAuthTransport] .
5555
5656GitHub Apps authentication can be provided by the
5757https://github.com/bradleyfalzon/ghinstallation package.
@@ -100,15 +100,15 @@ limited to 60 requests per hour, while authenticated clients can make up to
100100clients are limited to 10 requests per minute, while authenticated clients
101101can make up to 30 requests per minute. To receive the higher rate limit when
102102making calls that are not issued on behalf of a user,
103- use UnauthenticatedRateLimitedTransport.
103+ use [ UnauthenticatedRateLimitedTransport] .
104104
105- The returned Response. Rate value contains the rate limit information
105+ The returned [ Response].[ Rate] value contains the rate limit information
106106from the most recent API call. If a recent enough response isn't
107107available, you can use RateLimits to fetch the most up-to-date rate
108108limit data for the client.
109109
110- To detect an API rate limit error, you can check if its type is *github. RateLimitError.
111- For secondary rate limits, you can check if its type is *github. AbuseRateLimitError:
110+ To detect an API rate limit error, you can check if its type is *[ RateLimitError] .
111+ For secondary rate limits, you can check if its type is *[ AbuseRateLimitError] :
112112
113113 repos, _, err := client.Repositories.List(ctx, "", nil)
114114 if _, ok := err.(*github.RateLimitError); ok {
@@ -129,7 +129,7 @@ the GitHub side. Methods known to behave like this are documented specifying
129129this behavior.
130130
131131To detect this condition of error, you can check if its type is
132- *github. AcceptedError:
132+ *[ AcceptedError] :
133133
134134 stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo)
135135 if _, ok := err.(*github.AcceptedError); ok {
@@ -142,7 +142,7 @@ The GitHub REST API has good support for conditional HTTP requests
142142via the ETag header which will help prevent you from burning through your
143143rate limit, as well as help speed up your application. go-github does not
144144handle conditional requests directly, but is instead designed to work with a
145- caching http.Transport.
145+ caching [ http.Transport] .
146146
147147Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache
148148is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport
@@ -157,7 +157,7 @@ https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requ
157157
158158All structs for GitHub resources use pointer values for all non-repeated fields.
159159This allows distinguishing between unset fields and those set to a zero-value.
160- Helper functions have been provided to easily create these pointers for string,
160+ A helper function, [Ptr], has been provided to easily create these pointers for string,
161161bool, and int values. For example:
162162
163163 // create a new private repository named "foo"
@@ -173,10 +173,10 @@ Users who have worked with protocol buffers should find this pattern familiar.
173173
174174All requests for resource collections (repos, pull requests, issues, etc.)
175175support pagination. Pagination options are described in the
176- github. ListOptions struct and passed to the list methods directly or as an
176+ [ ListOptions] struct and passed to the list methods directly or as an
177177embedded type of a more specific list options struct (for example
178- github. PullRequestListOptions). Pages information is available via the
179- github. Response struct.
178+ [ PullRequestListOptions] ). Pages information is available via the
179+ [ Response] struct.
180180
181181 client := github.NewClient(nil)
182182
0 commit comments