renamed some variables in GetReposFromGitHub()
This commit is contained in:
parent
b08bed3618
commit
61a76e1a06
14
functions.go
14
functions.go
@ -80,8 +80,8 @@ func (config *Config) GetConfig() error {
|
||||
|
||||
// GetReposFromGitHub get starred repositories from github
|
||||
func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
||||
var repolist []GitHubRepo
|
||||
var repo []GitHubRepo
|
||||
var repopartiallist []GitHubRepo
|
||||
var repofulllist []GitHubRepo
|
||||
|
||||
fmt.Println("Getting GitHub starred repos")
|
||||
for num := 1; num <= config.githubconfig.PageNum; num++ {
|
||||
@ -98,17 +98,17 @@ func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(*respbody, &repo)
|
||||
err = json.Unmarshal(*respbody, &repopartiallist)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, elem := range repo {
|
||||
repolist = append(repolist, elem)
|
||||
for _, elem := range repopartiallist {
|
||||
repofulllist = append(repofulllist, elem)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(fmt.Sprintf("%d repositories from Github fetched", len(repolist)))
|
||||
return repolist, nil
|
||||
fmt.Println(fmt.Sprintf("%d repositories from Github fetched", len(repofulllist)))
|
||||
return repofulllist, nil
|
||||
}
|
||||
|
||||
// InvokeGitHub ...
|
||||
|
Loading…
Reference in New Issue
Block a user