diff options
Diffstat (limited to 'vendor/github.com/google/go-github/github/repos_statuses.go')
-rw-r--r-- | vendor/github.com/google/go-github/github/repos_statuses.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/google/go-github/github/repos_statuses.go b/vendor/github.com/google/go-github/github/repos_statuses.go index 65c2e0a..6db5010 100644 --- a/vendor/github.com/google/go-github/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/github/repos_statuses.go @@ -6,6 +6,7 @@ package github import ( + "context" "fmt" "time" ) @@ -42,7 +43,7 @@ func (r RepoStatus) String() string { // reference. ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref -func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) { +func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, ref) u, err := addOptions(u, opt) if err != nil { @@ -55,7 +56,7 @@ func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOpt } var statuses []*RepoStatus - resp, err := s.client.Do(req, &statuses) + resp, err := s.client.Do(ctx, req, &statuses) if err != nil { return nil, resp, err } @@ -67,7 +68,7 @@ func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOpt // reference. Ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#create-a-status -func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { +func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, ref) req, err := s.client.NewRequest("POST", u, status) if err != nil { @@ -75,7 +76,7 @@ func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *Repo } repoStatus := new(RepoStatus) - resp, err := s.client.Do(req, repoStatus) + resp, err := s.client.Do(ctx, req, repoStatus) if err != nil { return nil, resp, err } @@ -106,7 +107,7 @@ func (s CombinedStatus) String() string { // reference. ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref -func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) { +func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, ref) u, err := addOptions(u, opt) if err != nil { @@ -119,7 +120,7 @@ func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *Li } status := new(CombinedStatus) - resp, err := s.client.Do(req, status) + resp, err := s.client.Do(ctx, req, status) if err != nil { return nil, resp, err } |