diff options
| author | Jeff Carr <[email protected]> | 2024-12-03 13:24:41 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-03 13:24:41 -0600 |
| commit | 3600dbed8ceca3253afcd6b6ce1ee3f941aef30d (patch) | |
| tree | 9eda700b2d8efce5bba61558af33b15b919df844 /goSrcScan.go | |
| parent | dfae92e3c35e445e5a8098c720cac9b8d3f969c8 (diff) | |
unbelievable. rill is great.
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 +} |
