Add/cloneme (#125)

* Update github.go
This commit is contained in:
Jay Gabriels 2021-04-02 09:55:59 -07:00 committed by GitHub
parent e5f59fb78c
commit 2ae5eecc1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,19 @@ func (c Github) GetUserRepos(targetUser string) ([]Repo, error) {
if err != nil {
return nil, err
}
if targetUser == "" {
userRepos := []*github.Repository{}
for _, repo := range repos {
if *repo.Owner.Type == "User" {
userRepos = append(userRepos, repo)
}
}
repos = userRepos
}
allRepos = append(allRepos, repos...)
if resp.NextPage == 0 {
break