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.
Add a new error type, TwoFactorAuthError, which identifies the need to
include a one-time password when using Basic Auth for a user with
two-factor auth enabled.
An example of using both the new transport and error type can be seen in
examples/basicauth/main.go.
fixes#258
This provides somewhat reasonable string representations of GitHub
structs. This is specifically designed for this library and takes a
number of shortcuts where it can, so is not suitable as a general
purpose solution. That said, I am exporting this function because it is
useful for things like printing out slices of GitHub structs, as can be
seen in examples/example.go.
I am certainly open to suggestions for what exactly the stringified
output should look like. Currently, I think I've found a reasonable
compromise between fmt's "%v" and "%s" output.
Since the library has received external contributions, Google is no
longer the sole copyright holder. Update the boilerplate at the top of
each file to reflect that, and add AUTHORS and CONTRIBUTORS files to
track this information.
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.