Also properly return a 204 response on methods that don't include a
response body. This has no actual effect on current tests, but more
accurately reflects what the GitHub API really returns and might make a
difference in the future.
if we have an error reading the body of an API error response, still
return an ErrorResposne with the original response struct. Simply
returning a string stating that we couldn't read the response body
doesn't give the caller anything actionable to work with or attempt to
process.
internally, http.Error uses fmt.Fprintln() which will append a newline
to what should be an empty response body. In one of my previous tests,
this was causing spurious errors. I've since rewritten that test, but
still best to avoid it here.
- standardize on "url_" for internal vars rather than "urls" or "url"
- move var definition closer to first use in several tests
- add .gitignore for test binary
This commit adds the core library funcationality and establishes the
general calling style and testing structure. Only a few GitHub API
methods related to organizations and repositories are included in this
first commit, mainly to cement the calling style.