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.common.client = c
	c.Activity = (*ActivityService)(&c.common)
	c.Admin = (*AdminService)(&c.common)
	c.Apps = (*AppsService)(&c.common)
	c.Authorizations = (*AuthorizationsService)(&c.common)
	c.Gists = (*GistsService)(&c.common)
	c.Git = (*GitService)(&c.common)
	c.Gitignores = (*GitignoresService)(&c.common)
	c.Issues = (*IssuesService)(&c.common)
	c.Licenses = (*LicensesService)(&c.common)
	c.Marketplace = &MarketplaceService{client: c}
	c.Migrations = (*MigrationService)(&c.common)
	c.Organizations = (*OrganizationsService)(&c.common)
	c.Projects = (*ProjectsService)(&c.common)
	c.PullRequests = (*PullRequestsService)(&c.common)
	c.Reactions = (*ReactionsService)(&c.common)
	c.Repositories = (*RepositoriesService)(&c.common)
	c.Search = (*SearchService)(&c.common)
	c.Users = (*UsersService)(&c.common)
	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"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/google/go-querystring/query"
)
const (
	libraryVersion = "15"
	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"
	headerOTP           = "X-GitHub-OTP"
	mediaTypeV3                = "application/vnd.github.v3+json"
	defaultMediaType           = "application/octet-stream"
	mediaTypeV3SHA             = "application/vnd.github.v3.sha"
	mediaTypeV3Diff            = "application/vnd.github.v3.diff"
	mediaTypeV3Patch           = "application/vnd.github.v3.patch"
	mediaTypeOrgPermissionRepo = "application/vnd.github.v3.repository+json"
	mediaTypeLicensesPreview = "application/vnd.github.drax-preview+json"
	mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
	mediaTypeProtectedBranchesPreview = "application/vnd.github.loki-preview+json"
	mediaTypeMigrationsPreview = "application/vnd.github.wyandotte-preview+json"
	mediaTypeDeploymentStatusPreview = "application/vnd.github.ant-man-preview+json"
	mediaTypeImportPreview = "application/vnd.github.barred-rock-preview"
	mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"
	mediaTypeGitSigningPreview = "application/vnd.github.cryptographer-preview+json"
	mediaTypeTimelinePreview = "application/vnd.github.mockingbird-preview+json"
	mediaTypeRepositoryInvitationsPreview = "application/vnd.github.swamp-thing-preview+json"
	mediaTypePagesPreview = "application/vnd.github.mister-fantastic-preview+json"
	mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
	mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"
	mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview+json"
	mediaTypeBlockUsersPreview = "application/vnd.github.giant-sentry-fist-preview+json"
	mediaTypeRepositoryCommunityHealthMetricsPreview = "application/vnd.github.black-panther-preview+json"
	mediaTypeCodesOfConductPreview = "application/vnd.github.scarlet-witch-preview+json"
	mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"
	mediaTypeTeamReviewPreview = "application/vnd.github.thor-preview+json"
	mediaTypeMarketplacePreview = "application/vnd.github.valkyrie-preview+json"
	mediaTypeNestedTeamsPreview = "application/vnd.github.hellcat-preview+json"
	mediaTypeRepositoryTransferPreview = "application/vnd.github.nightshade-preview+json"
	mediaTypeGraphQLNodeIDPreview = "application/vnd.github.jean-grey-preview+json"
)
type Client struct {
	clientMu sync.Mutex    
	client   *http.Client  
	BaseURL *url.URL
	UploadURL *url.URL
	UserAgent string
	rateMu     sync.Mutex
	rateLimits [categories]Rate  
	common service  
	Activity       *ActivityService
	Admin          *AdminService
	Apps           *AppsService
	Authorizations *AuthorizationsService
	Gists          *GistsService
	Git            *GitService
	Gitignores     *GitignoresService
	Issues         *IssuesService
	Licenses       *LicensesService
	Marketplace    *MarketplaceService
	Migrations     *MigrationService
	Organizations  *OrganizationsService
	Projects       *ProjectsService
	PullRequests   *PullRequestsService
	Reactions      *ReactionsService
	Repositories   *RepositoriesService
	Search         *SearchService
	Users          *UsersService
}
type service struct {
	client *Client
}
type ListOptions struct {
	Page int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
}
type UploadOptions struct {
	Name string `url:"name,omitempty"`
}
type RawType uint8
const (
	Diff RawType = 1 + iota
	Patch
)
type RawOptions struct {
	Type RawType
}
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
}