diff --git a/github/issues_comments.go b/github/issues_comments.go index b3a2c5a..db48e14 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -37,6 +37,8 @@ type IssueListCommentsOptions struct { // Since filters comments by time. Since time.Time `url:"since,omitempty"` + + ListOptions } // ListComments lists all comments on the specified issue. Specifying an issue diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 4dff270..697f438 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -24,12 +24,16 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { "sort": "updated", "direction": "desc", "since": "2002-02-10T15:30:00Z", + "page": "2", }) fmt.Fprint(w, `[{"id":1}]`) }) - opt := &IssueListCommentsOptions{"updated", "desc", - time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), + opt := &IssueListCommentsOptions{ + Sort: "updated", + Direction: "desc", + Since: time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), + ListOptions: ListOptions{Page: 2}, } comments, _, err := client.Issues.ListComments("o", "r", 0, opt) if err != nil { diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 0dc2292..bfbad9a 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -37,6 +37,8 @@ type PullRequestListCommentsOptions struct { // Since filters comments by time. Since time.Time `url:"since,omitempty"` + + ListOptions } // ListComments lists all comments on the specified pull request. Specifying a diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 9734d96..7885ab1 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -24,12 +24,16 @@ func TestPullRequestsService_ListComments_allPulls(t *testing.T) { "sort": "updated", "direction": "desc", "since": "2002-02-10T15:30:00Z", + "page": "2", }) fmt.Fprint(w, `[{"id":1}]`) }) - opt := &PullRequestListCommentsOptions{"updated", "desc", - time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), + opt := &PullRequestListCommentsOptions{ + Sort: "updated", + Direction: "desc", + Since: time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), + ListOptions: ListOptions{Page: 2}, } pulls, _, err := client.PullRequests.ListComments("o", "r", 0, opt)