Skip to content

Commit

Permalink
Add per_page option to getting repositories call
Browse files Browse the repository at this point in the history
  • Loading branch information
umutphp committed Jun 27, 2020
1 parent 257b2c1 commit 9d7344f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ func (cli *CLI) Initialize() bool {
}

func (cli *CLI) GetRepos() []*github.Repository {
opts := new(github.RepositoryListOptions)
opts.PerPage = 1000
opts.Page = 1
// list all repositories for the authenticated user
repos, _, err := cli.client.Repositories.List(cli.context, cli.username, nil)
repos, _, err := cli.client.Repositories.List(cli.context, cli.username, opts)

if err != nil {
fmt.Println("Cannot fetch repositories from GitHub. Error message:", err)
Expand Down

0 comments on commit 9d7344f

Please sign in to comment.