Browse Source

pass page parameters on issues.list method

Refs #22
Will Norris 13 years ago
parent
commit
825685f063
2 changed files with 4 additions and 0 deletions
  1. +2
    -0
      github/issues.go
  2. +2
    -0
      github/issues_test.go

+ 2
- 0
github/issues.go View File

@ -6,6 +6,7 @@
package github
import (
"strconv"
"fmt"
"net/url"
"strings"
@ -107,6 +108,7 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]Issue, er
"labels": {strings.Join(opt.Labels, ",")},
"sort": {opt.Sort},
"direction": {opt.Direction},
"page": []string{strconv.Itoa(opt.Page)},
}
if !opt.Since.IsZero() {
params.Add("since", opt.Since.Format(time.RFC3339))


+ 2
- 0
github/issues_test.go View File

@ -27,6 +27,7 @@ func TestIssuesService_List_all(t *testing.T) {
"sort": "updated",
"direction": "asc",
"since": "2002-02-10T15:30:00Z",
"page": "1",
})
fmt.Fprint(w, `[{"number":1}]`)
})
@ -34,6 +35,7 @@ func TestIssuesService_List_all(t *testing.T) {
opt := &IssueListOptions{
"all", "closed", []string{"a", "b"}, "updated", "asc",
time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC),
1,
}
issues, err := client.Issues.List(true, opt)


Loading…
Cancel
Save