From 7757d83d9924056def40710dd8517b16e0d3c4c6 Mon Sep 17 00:00:00 2001 From: Juan Rios Date: Wed, 22 Jul 2020 21:32:19 -0400 Subject: [PATCH] Removes: Sort & Direction Fields From IssueComments - The `Sort` & `Direction` fields in` IssueListCommentsOptions` were removed from the github api so they no longer work. - Fields have been removed from the struct and any corresponding tests > These are tagged as breaking changes --- github/github-accessors.go | 16 ---------------- github/issues_comments.go | 6 ------ github/issues_comments_test.go | 8 ++------ 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 8c591ce838a..aac5ac0476b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5084,14 +5084,6 @@ func (i *IssueEvent) GetURL() string { return *i.URL } -// GetDirection returns the Direction field if it's non-nil, zero value otherwise. -func (i *IssueListCommentsOptions) GetDirection() string { - if i == nil || i.Direction == nil { - return "" - } - return *i.Direction -} - // GetSince returns the Since field if it's non-nil, zero value otherwise. func (i *IssueListCommentsOptions) GetSince() time.Time { if i == nil || i.Since == nil { @@ -5100,14 +5092,6 @@ func (i *IssueListCommentsOptions) GetSince() time.Time { return *i.Since } -// GetSort returns the Sort field if it's non-nil, zero value otherwise. -func (i *IssueListCommentsOptions) GetSort() string { - if i == nil || i.Sort == nil { - return "" - } - return *i.Sort -} - // GetAssignee returns the Assignee field if it's non-nil, zero value otherwise. func (i *IssueRequest) GetAssignee() string { if i == nil || i.Assignee == nil { diff --git a/github/issues_comments.go b/github/issues_comments.go index fc67511bf6d..eade48eed10 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -35,12 +35,6 @@ func (i IssueComment) String() string { // IssueListCommentsOptions specifies the optional parameters to the // IssuesService.ListComments method. type IssueListCommentsOptions struct { - // Sort specifies how to sort comments. Possible values are: created, updated. - Sort *string `url:"sort,omitempty"` - - // Direction in which to sort comments. Possible values are: asc, desc. - Direction *string `url:"direction,omitempty"` - // Since filters comments by time. Since *time.Time `url:"since,omitempty"` diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 69acb24280e..2b5ec50c29c 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -23,18 +23,14 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) testFormValues(t, r, values{ - "sort": "updated", - "direction": "desc", - "since": "2002-02-10T15:30:00Z", - "page": "2", + "since": "2002-02-10T15:30:00Z", + "page": "2", }) fmt.Fprint(w, `[{"id":1}]`) }) since := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) opt := &IssueListCommentsOptions{ - Sort: String("updated"), - Direction: String("desc"), Since: &since, ListOptions: ListOptions{Page: 2}, }