aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/issues_comments.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/issues_comments.go')
-rw-r--r--vendor/github.com/google/go-github/github/issues_comments.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/vendor/github.com/google/go-github/github/issues_comments.go b/vendor/github.com/google/go-github/github/issues_comments.go
index e8a852e..fd72657 100644
--- a/vendor/github.com/google/go-github/github/issues_comments.go
+++ b/vendor/github.com/google/go-github/github/issues_comments.go
@@ -6,6 +6,7 @@
package github
import (
+ "context"
"fmt"
"time"
)
@@ -46,7 +47,7 @@ type IssueListCommentsOptions struct {
// number of 0 will return all comments on all issues for the repository.
//
// GitHub API docs: https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue
-func (s *IssuesService) ListComments(owner string, repo string, number int, opt *IssueListCommentsOptions) ([]*IssueComment, *Response, error) {
+func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opt *IssueListCommentsOptions) ([]*IssueComment, *Response, error) {
var u string
if number == 0 {
u = fmt.Sprintf("repos/%v/%v/issues/comments", owner, repo)
@@ -67,7 +68,7 @@ func (s *IssuesService) ListComments(owner string, repo string, number int, opt
req.Header.Set("Accept", mediaTypeReactionsPreview)
var comments []*IssueComment
- resp, err := s.client.Do(req, &comments)
+ resp, err := s.client.Do(ctx, req, &comments)
if err != nil {
return nil, resp, err
}
@@ -78,7 +79,7 @@ func (s *IssuesService) ListComments(owner string, repo string, number int, opt
// GetComment fetches the specified issue comment.
//
// GitHub API docs: https://developer.github.com/v3/issues/comments/#get-a-single-comment
-func (s *IssuesService) GetComment(owner string, repo string, id int) (*IssueComment, *Response, error) {
+func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, id int) (*IssueComment, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, id)
req, err := s.client.NewRequest("GET", u, nil)
@@ -90,7 +91,7 @@ func (s *IssuesService) GetComment(owner string, repo string, id int) (*IssueCom
req.Header.Set("Accept", mediaTypeReactionsPreview)
comment := new(IssueComment)
- resp, err := s.client.Do(req, comment)
+ resp, err := s.client.Do(ctx, req, comment)
if err != nil {
return nil, resp, err
}
@@ -101,14 +102,14 @@ func (s *IssuesService) GetComment(owner string, repo string, id int) (*IssueCom
// CreateComment creates a new comment on the specified issue.
//
// GitHub API docs: https://developer.github.com/v3/issues/comments/#create-a-comment
-func (s *IssuesService) CreateComment(owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) {
+func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number)
req, err := s.client.NewRequest("POST", u, comment)
if err != nil {
return nil, nil, err
}
c := new(IssueComment)
- resp, err := s.client.Do(req, c)
+ resp, err := s.client.Do(ctx, req, c)
if err != nil {
return nil, resp, err
}
@@ -119,14 +120,14 @@ func (s *IssuesService) CreateComment(owner string, repo string, number int, com
// EditComment updates an issue comment.
//
// GitHub API docs: https://developer.github.com/v3/issues/comments/#edit-a-comment
-func (s *IssuesService) EditComment(owner string, repo string, id int, comment *IssueComment) (*IssueComment, *Response, error) {
+func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, id int, comment *IssueComment) (*IssueComment, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, id)
req, err := s.client.NewRequest("PATCH", u, comment)
if err != nil {
return nil, nil, err
}
c := new(IssueComment)
- resp, err := s.client.Do(req, c)
+ resp, err := s.client.Do(ctx, req, c)
if err != nil {
return nil, resp, err
}
@@ -137,11 +138,11 @@ func (s *IssuesService) EditComment(owner string, repo string, id int, comment *
// DeleteComment deletes an issue comment.
//
// GitHub API docs: https://developer.github.com/v3/issues/comments/#delete-a-comment
-func (s *IssuesService) DeleteComment(owner string, repo string, id int) (*Response, error) {
+func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, id int) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, id)
req, err := s.client.NewRequest("DELETE", u, nil)
if err != nil {
return nil, err
}
- return s.client.Do(req, nil)
+ return s.client.Do(ctx, req, nil)
}