Skip to content

Commit aed46a3

Browse files
committed
add PerPage to ListOptions
1 parent 4b4aed3 commit aed46a3

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

github/github.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ type Client struct {
6666
type ListOptions struct {
6767
// For paginated result sets, page of results to retrieve.
6868
Page int
69+
70+
// For paginated result sets, the number of results to include per page.
71+
PerPage int
6972
}
7073

7174
// NewClient returns a new GitHub API client. If a nil httpClient is

github/orgs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestOrganizationsService_List_specifiedUser(t *testing.T) {
4343
fmt.Fprint(w, `[{"id":1},{"id":2}]`)
4444
})
4545

46-
opt := &ListOptions{2}
46+
opt := &ListOptions{Page: 2}
4747
orgs, _, err := client.Organizations.List("u", opt)
4848
if err != nil {
4949
t.Errorf("Organizations.List returned error: %v", err)

github/repos_hooks_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestRepositoriesService_ListHooks(t *testing.T) {
5757
fmt.Fprint(w, `[{"id":1}, {"id":2}]`)
5858
})
5959

60-
opt := &ListOptions{2}
60+
opt := &ListOptions{Page: 2}
6161

6262
hooks, _, err := client.Repositories.ListHooks("o", "r", opt)
6363
if err != nil {

github/users_followers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) {
6767
fmt.Fprint(w, `[{"id":1}]`)
6868
})
6969

70-
opts := &ListOptions{2}
70+
opts := &ListOptions{Page: 2}
7171
users, _, err := client.Users.ListFollowing("", opts)
7272
if err != nil {
7373
t.Errorf("Users.ListFollowing returned error: %v", err)

0 commit comments

Comments
 (0)