summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-03-09 16:49:57 -0600
committerJeff Carr <[email protected]>2024-03-09 16:49:57 -0600
commit06904e11588c9db3ae4289da3ea4e131568fa1a8 (patch)
tree1a034c9ae40d0fe9a47d9e2b86c363f3288d9191
parent4dbfd68272d1753562fd25e384148bcdf47f6218 (diff)
sort go.work filev0.22.3v0.22.2
-rw-r--r--common.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/common.go b/common.go
index 075b026..debea4f 100644
--- a/common.go
+++ b/common.go
@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "sort"
"go.wit.com/gui"
"go.wit.com/lib/gui/repostatus"
@@ -191,7 +192,16 @@ func (rl *RepoList) MakeGoWork() error {
fmt.Fprintln(f, "go 1.21.4") // fix this
fmt.Fprintln(f, "")
fmt.Fprintln(f, "use (")
- for _, repo := range rl.allrepos {
+
+ keys := make([]string, 0, len(rl.allrepos))
+
+ for k := range rl.allrepos {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+
+ for _, k := range keys {
+ repo := rl.allrepos[k]
if repo.Status.GoPath() == "" {
// skip repos that aren't go
// todo: handle non-flat repos?
@@ -200,8 +210,8 @@ func (rl *RepoList) MakeGoWork() error {
if repo.Status.Exists("go.mod") {
fmt.Fprintln(f, "\t"+repo.Status.GoPath())
} else {
- log.Info("missing go.mod for", repo.Status.Path())
- repo.Status.MakeRedomod()
+ log.Log(REPO, "missing go.mod for", repo.Status.Path())
+ // repo.Status.MakeRedomod()
}
}
fmt.Fprintln(f, ")")