diff options
| author | Jeff Carr <[email protected]> | 2025-10-19 06:32:34 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-19 06:32:34 -0500 |
| commit | 5a8bc9367e17e4e03be389a8896a93ed8d4c93c1 (patch) | |
| tree | 6a6c0275d2f91c1eb39bd3d34bb42b32ec1c698d | |
| parent | b8012e05654c9823099fd4bb767c73a4229559f8 (diff) | |
notes for laterv0.0.186
| -rw-r--r-- | cleanGoSum.go | 4 | ||||
| -rw-r--r-- | iterByMode.go | 25 |
2 files changed, 27 insertions, 2 deletions
diff --git a/cleanGoSum.go b/cleanGoSum.go index aa23d8c..61f6036 100644 --- a/cleanGoSum.go +++ b/cleanGoSum.go @@ -140,8 +140,8 @@ func (f *Forge) TrimGoSum(check *gitpb.Repo) error { } // rewrite the go.sum file -// data, _ := os.ReadFile("go.sum") -// cobol.DumbTable(string(data)) + // data, _ := os.ReadFile("go.sum") + // cobol.DumbTable(string(data)) newfilename := filepath.Join(filepath.Join(check.FullPath, "go.sum")) newf, err := os.OpenFile(newfilename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644) diff --git a/iterByMode.go b/iterByMode.go new file mode 100644 index 0000000..37866ec --- /dev/null +++ b/iterByMode.go @@ -0,0 +1,25 @@ +package forgepb + +import ( + "iter" + "strings" + + "go.wit.com/lib/protobuf/gitpb" +) + +func (f *Forge) IterByMode() iter.Seq[*gitpb.Repo] { + if f == nil { + panic("forge is not initialized") + } + repos := gitpb.NewRepos() + if f.Config.Mode == ForgeMode_NORMAL { + for r := range f.Repos.IterAll() { + if !strings.HasPrefix(r.Namespace, "go.wit.com") { + continue + } + repos.Append(r) + } + return repos.IterByNamespace() + } + return f.Repos.IterAll() +} |
