An upcoming change to Go 1.7 allows the json package to be able to encode maps
with the integer keys. Thus, this is no longer a good way to generate intentional
JSON failures.
Reference:
f05c3aa24d
Client.Rate() method is unreliable in situations when API calls are made
by others that may hit different rate limit categories (core and search).
Each API call already returns a Response struct that contains an accurate
Rate, so that's a better mechanism to access this information.
See relevant discussion at https://github.com/google/go-github/pull/347#discussion_r61920849.
When possible to do so reliably, i.e., the client knows that the rate
limit is exceeded and reset time is in the future, immediately return
*RateLimitError without making network calls to GitHub API.
Add a unit test covering RateLimits method populating client.rateLimits.
Remove commented out code.
Helps #152 and #153.
In GitHub API, there are currently two categories of rate limits: core
and search. Previously, the client only tracked the rate limit from the
most recent API call. This change makes it track both rate limit
categories.
This will be useful in the following commit.
This describes the package in a way that can be seen via godoc,
and makes it so that the following command succeeds without
"no buildable Go source files" error:
go build github.com/google/go-github/...
Also make tip a fast-finish allowed failure. That way, if CI fails on
tip due to a temporary issue with tip, it will not break build status.
However, it's still possible to see tip build status by looking at CI
details page.
Do not run go vet with Go 1.4 since it's not included in the standard
library, and it's no longer available in external standard library.
If `RepositoriesService.DownloadReleaseAsset` encounters an error from
the GitHub API (e.g., 404 Not Found), The error would not be returned
by the method and instead the error payload would be delivered as the
`io.ReadCloser`. This patch resolves this with `CheckResponse`.
Fixes#343
It's not obvious from reading the GitHub API docs or the go-github docs
that RepositoryContent.Content may be base64 encoded. This adds
clarifying docs for that as well as the String method.
Also add an example of using the GetReadme method.
Fixes#322Fixes#323
Decode only works if r.Content is actually encoded, which I'm not sure
that it always will be. GetContent will return the content, decoding it
only if necessary. Deprecate the old Decode method.
Also expand and cleanup the tests for both of these methods.
Related to #323
The markdown and repo list examples are pretty simple and can easily be
moved to be inline samples so that they render as part of the packages
godocs. This helps make them more visible even if they won't run in the
browser. The basic auth example requires interacting with the user, so
leaving it where it is. Future examples should be included inline
whenever possible.