diff options
Diffstat (limited to 'goSrcScan.go')
| -rw-r--r-- | goSrcScan.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/goSrcScan.go b/goSrcScan.go index 2287149..9aedd85 100644 --- a/goSrcScan.go +++ b/goSrcScan.go @@ -155,3 +155,37 @@ func (f *Forge) rillScanDirs(gopaths []string) (int, error) { return counter, err } + +func (f *Forge) RillRedoGoMod() int { + var all []*gitpb.Repo + repos := f.Repos.SortByGoPath() + for repos.Scan() { + repo := repos.Next() + if !repo.IsValid() { + log.Printf("%10s %-50s", "old?", repo.GetGoPath()) + continue + } + all = append(all, repo) + } + // Convert a slice of user IDs into a channel + ids := rill.FromSlice(all, nil) + + var counter int + // Read users from the API. + // Concurrency = 20 + dirs := rill.Map(ids, 50, func(id *gitpb.Repo) (*gitpb.Repo, error) { + return id, nil + }) + + err := rill.ForEach(dirs, 20, func(repo *gitpb.Repo) error { + counter += 1 + repo.RedoGoMod() + return nil + }) + + if err != nil { + log.Info("rill.ForEach() error:", err) + } + + return counter +} |
