Update deps

This commit is contained in:
Jeff Mitchell
2016-06-30 14:19:03 -04:00
parent 8545851f3d
commit 1651787019
213 changed files with 19759 additions and 2805 deletions

View File

@@ -14,9 +14,7 @@ import (
// methods of the GitHub API.
//
// GitHub API docs: http://developer.github.com/v3/issues/
type IssuesService struct {
client *Client
}
type IssuesService service
// Issue represents a GitHub issue on a repository.
type Issue struct {
@@ -37,6 +35,7 @@ type Issue struct {
PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"`
Repository *Repository `json:"repository,omitempty"`
Reactions *Reactions `json:"reactions,omitempty"`
Assignees []*User `json:"assignees,omitempty"`
// TextMatches is only populated from search results that request text matches
// See: search.go and https://developer.github.com/v3/search/#text-match-metadata
@@ -57,6 +56,7 @@ type IssueRequest struct {
Assignee *string `json:"assignee,omitempty"`
State *string `json:"state,omitempty"`
Milestone *int `json:"milestone,omitempty"`
Assignees *[]string `json:"assignees,omitempty"`
}
// IssueListOptions specifies the optional parameters to the IssuesService.List
@@ -102,7 +102,7 @@ type PullRequestLinks struct {
// repositories.
//
// GitHub API docs: http://developer.github.com/v3/issues/#list-issues
func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]Issue, *Response, error) {
func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]*Issue, *Response, error) {
var u string
if all {
u = "issues"
@@ -116,12 +116,12 @@ func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]Issue, *Respons
// authenticated user.
//
// GitHub API docs: http://developer.github.com/v3/issues/#list-issues
func (s *IssuesService) ListByOrg(org string, opt *IssueListOptions) ([]Issue, *Response, error) {
func (s *IssuesService) ListByOrg(org string, opt *IssueListOptions) ([]*Issue, *Response, error) {
u := fmt.Sprintf("orgs/%v/issues", org)
return s.listIssues(u, opt)
}
func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]Issue, *Response, error) {
func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, *Response, error) {
u, err := addOptions(u, opt)
if err != nil {
return nil, nil, err
@@ -135,7 +135,7 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]Issue, *R
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
issues := new([]Issue)
issues := new([]*Issue)
resp, err := s.client.Do(req, issues)
if err != nil {
return nil, resp, err
@@ -187,7 +187,7 @@ type IssueListByRepoOptions struct {
// ListByRepo lists the issues for the specified repository.
//
// GitHub API docs: http://developer.github.com/v3/issues/#list-issues-for-a-repository
func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRepoOptions) ([]Issue, *Response, error) {
func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRepoOptions) ([]*Issue, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues", owner, repo)
u, err := addOptions(u, opt)
if err != nil {
@@ -202,7 +202,7 @@ func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRe
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
issues := new([]Issue)
issues := new([]*Issue)
resp, err := s.client.Do(req, issues)
if err != nil {
return nil, resp, err
@@ -243,6 +243,9 @@ func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) (
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview)
i := new(Issue)
resp, err := s.client.Do(req, i)
if err != nil {
@@ -262,6 +265,9 @@ func (s *IssuesService) Edit(owner string, repo string, number int, issue *Issue
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview)
i := new(Issue)
resp, err := s.client.Do(req, i)
if err != nil {
@@ -281,9 +287,6 @@ func (s *IssuesService) Lock(owner string, repo string, number int) (*Response,
return nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeIssueLockingPreview)
return s.client.Do(req, nil)
}
@@ -297,8 +300,5 @@ func (s *IssuesService) Unlock(owner string, repo string, number int) (*Response
return nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeIssueLockingPreview)
return s.client.Do(req, nil)
}