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
|
// GetReposFromGitHub get starred repositories from github
|
||||||
func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
||||||
var repolist []GitHubRepo
|
var repopartiallist []GitHubRepo
|
||||||
var repo []GitHubRepo
|
var repofulllist []GitHubRepo
|
||||||
|
|
||||||
fmt.Println("Getting GitHub starred repos")
|
fmt.Println("Getting GitHub starred repos")
|
||||||
for num := 1; num <= config.githubconfig.PageNum; num++ {
|
for num := 1; num <= config.githubconfig.PageNum; num++ {
|
||||||
@ -98,17 +98,17 @@ func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = json.Unmarshal(*respbody, &repo)
|
err = json.Unmarshal(*respbody, &repopartiallist)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, elem := range repo {
|
for _, elem := range repopartiallist {
|
||||||
repolist = append(repolist, elem)
|
repofulllist = append(repofulllist, elem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(fmt.Sprintf("%d repositories from Github fetched", len(repolist)))
|
fmt.Println(fmt.Sprintf("%d repositories from Github fetched", len(repofulllist)))
|
||||||
return repolist, nil
|
return repofulllist, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// InvokeGitHub ...
|
// InvokeGitHub ...
|
||||||
|
Loading…
Reference in New Issue
Block a user