summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-28 08:54:47 -0600
committerJeff Carr <[email protected]>2024-11-28 08:54:47 -0600
commit02b9ed57b3e1cff11d4ac45c4078900e8ab9685e (patch)
tree73ca7e88bfd2f67d1fa8d46a9e1247669b6c3283
parent5a9b953d33cecf13c6ddc0ad002c41d62213b3e1 (diff)
climbing up hill
-rw-r--r--Makefile1
-rw-r--r--repos.sort.go14
-rw-r--r--scanGoSrc/main.go9
3 files changed, 8 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index c9d0d88..7fb1b82 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ lint:
# autofixes your import headers in your golang files
goimports:
goimports -w *.go
+ make -C scanGoSrc/ goimports
redomod:
rm -f go.*
diff --git a/repos.sort.go b/repos.sort.go
index b4656e6..8bde45a 100644
--- a/repos.sort.go
+++ b/repos.sort.go
@@ -35,7 +35,7 @@ func (it *RepoIterator) Scan() bool {
}
// Repo returns the current repo.
-func (it *RepoIterator) Repo() *Repo {
+func (it *RepoIterator) Next() *Repo {
if it.packs[it.index-1] == nil {
for i, d := range it.packs {
fmt.Println("i =", i, d)
@@ -61,10 +61,10 @@ func (r *Repos) All() *RepoIterator {
return iterator
}
-func (r *Repos) SortByName() *RepoIterator {
+func (r *Repos) SortByPath() *RepoIterator {
packs := r.selectAllRepo()
- sort.Sort(RepoByName(packs))
+ sort.Sort(RepoByPath(packs))
iterator := NewRepoIterator(packs)
return iterator
@@ -77,11 +77,11 @@ func (all *Repos) Len() int {
return len(all.Repos)
}
-type RepoByName []*Repo
+type RepoByPath []*Repo
-func (a RepoByName) Len() int { return len(a) }
-func (a RepoByName) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath }
-func (a RepoByName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a RepoByPath) Len() int { return len(a) }
+func (a RepoByPath) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath }
+func (a RepoByPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// safely returns a slice of pointers to the Repo protobufs
func (all *Repos) selectAllRepo() []*Repo {
diff --git a/scanGoSrc/main.go b/scanGoSrc/main.go
index 460a2b5..f59ea77 100644
--- a/scanGoSrc/main.go
+++ b/scanGoSrc/main.go
@@ -3,7 +3,6 @@ package main
import (
"os"
- "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@@ -12,14 +11,6 @@ import (
var VERSION string
func main() {
- var config forgepb.ForgeConfigs
- if err := config.ConfigLoad(); err != nil {
- log.Warn("forgepb.ConfigLoad() failed", err)
- os.Exit(-1)
- }
-
- config.PrintTable()
-
var repos *gitpb.Repos
repos = new(gitpb.Repos)