diff --git a/github/github.go b/github/github.go index a9977b7..2c2d1b4 100644 --- a/github/github.go +++ b/github/github.go @@ -66,6 +66,9 @@ type Client struct { type ListOptions struct { // For paginated result sets, page of results to retrieve. Page int + + // For paginated result sets, the number of results to include per page. + PerPage int } // NewClient returns a new GitHub API client. If a nil httpClient is diff --git a/github/orgs_test.go b/github/orgs_test.go index dfb28f1..84ebc54 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -43,7 +43,7 @@ func TestOrganizationsService_List_specifiedUser(t *testing.T) { fmt.Fprint(w, `[{"id":1},{"id":2}]`) }) - opt := &ListOptions{2} + opt := &ListOptions{Page: 2} orgs, _, err := client.Organizations.List("u", opt) if err != nil { t.Errorf("Organizations.List returned error: %v", err) diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 4b7a39c..295d382 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -57,7 +57,7 @@ func TestRepositoriesService_ListHooks(t *testing.T) { fmt.Fprint(w, `[{"id":1}, {"id":2}]`) }) - opt := &ListOptions{2} + opt := &ListOptions{Page: 2} hooks, _, err := client.Repositories.ListHooks("o", "r", opt) if err != nil { diff --git a/github/users_followers_test.go b/github/users_followers_test.go index 3bf5ac7..988739d 100644 --- a/github/users_followers_test.go +++ b/github/users_followers_test.go @@ -67,7 +67,7 @@ func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { fmt.Fprint(w, `[{"id":1}]`) }) - opts := &ListOptions{2} + opts := &ListOptions{Page: 2} users, _, err := client.Users.ListFollowing("", opts) if err != nil { t.Errorf("Users.ListFollowing returned error: %v", err)