mirror of
https://github.com/grdl/git-get.git
synced 2026-02-05 03:49:42 +00:00
Fix smaller issues found by various linters
This commit is contained in:
@@ -105,13 +105,13 @@ func (f *RepoFinder) Find() error {
|
||||
// If fetch equals true, it first fetches from the remote repo before loading the status.
|
||||
// Each repo is loaded concurrently by a separate worker, with max 100 workers being active at the same time.
|
||||
func (f *RepoFinder) LoadAll(fetch bool) []*Status {
|
||||
var statuses []*Status
|
||||
statuses := []*Status{}
|
||||
|
||||
reposChan := make(chan *Repo, f.maxWorkers)
|
||||
statusChan := make(chan *Status, f.maxWorkers)
|
||||
|
||||
// Fire up workers. They listen on reposChan, load status and send the result to statusChan.
|
||||
for i := 0; i < f.maxWorkers; i++ {
|
||||
for range f.maxWorkers {
|
||||
go statusWorker(fetch, reposChan, statusChan)
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ func (r *Repo) Upstream(branch string) (string, error) {
|
||||
out, err := run.Git("rev-parse", "--abbrev-ref", "--symbolic-full-name", fmt.Sprintf("%s@{upstream}", branch)).OnRepo(r.path).AndCaptureLine()
|
||||
if err != nil {
|
||||
// TODO: no upstream will also throw an error.
|
||||
// lint:ignore nilerr fix when working on TODO
|
||||
return "", nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user