func NewClient(httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}
	baseURL, _ := url.Parse(defaultBaseURL)
	uploadURL, _ := url.Parse(uploadBaseURL)
	c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent, UploadURL: uploadURL}
	c.Activity = &ActivityService{client: c}
	c.Gists = &GistsService{client: c}
	c.Git = &GitService{client: c}
	c.Gitignores = &GitignoresService{client: c}
	c.Issues = &IssuesService{client: c}
	c.Organizations = &OrganizationsService{client: c}
	c.PullRequests = &PullRequestsService{client: c}
	c.Repositories = &RepositoriesService{client: c}
	c.Search = &SearchService{client: c}
	c.Users = &UsersService{client: c}
	c.Licenses = &LicensesService{client: c}
	return c
}
NewClient returns a new GitHub API client.  If a nil httpClient is
provided, http.DefaultClient will be used.  To use API methods which require
authentication, provide an http.Client that will perform the authentication
for you (such as that provided by the golang.org/x/oauth2 library).
package github
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"reflect"
	"strconv"
	"strings"
	"time"
	"github.com/google/go-querystring/query"
)
const (
	libraryVersion = "0.1"
	defaultBaseURL = "https://api.github.com/"
	uploadBaseURL  = "https://uploads.github.com/"
	userAgent      = "go-github/" + libraryVersion
	headerRateLimit     = "X-RateLimit-Limit"
	headerRateRemaining = "X-RateLimit-Remaining"
	headerRateReset     = "X-RateLimit-Reset"
	mediaTypeV3      = "application/vnd.github.v3+json"
	defaultMediaType = "application/octet-stream"
	mediaTypeLicensesPreview = "application/vnd.github.drax-preview+json"
	mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
	mediaTypeOrgPermissionPreview     = "application/vnd.github.ironman-preview+json"
	mediaTypeOrgPermissionRepoPreview = "application/vnd.github.ironman-preview.repository+json"
)
type Client struct {
	client *http.Client
	BaseURL *url.URL
	UploadURL *url.URL
	UserAgent string
	Rate Rate
	Activity      *ActivityService
	Gists         *GistsService
	Git           *GitService
	Gitignores    *GitignoresService
	Issues        *IssuesService
	Organizations *OrganizationsService
	PullRequests  *PullRequestsService
	Repositories  *RepositoriesService
	Search        *SearchService
	Users         *UsersService
	Licenses      *LicensesService
}
type ListOptions struct {
	Page int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
}
type UploadOptions struct {
	Name string `url:"name,omitempty"`
}
func addOptions(s string, opt interface{}) (string, error) {
	v := reflect.ValueOf(opt)
	if v.Kind() == reflect.Ptr && v.IsNil() {
		return s, nil
	}
	u, err := url.Parse(s)
	if err != nil {
		return s, err
	}
	qs, err := query.Values(opt)
	if err != nil {
		return s, err
	}
	u.RawQuery = qs.Encode()
	return u.String(), nil
}