climbing up hill
This commit is contained in:
parent
5a9b953d33
commit
02b9ed57b3
1
Makefile
1
Makefile
|
@ -17,6 +17,7 @@ lint:
|
||||||
# autofixes your import headers in your golang files
|
# autofixes your import headers in your golang files
|
||||||
goimports:
|
goimports:
|
||||||
goimports -w *.go
|
goimports -w *.go
|
||||||
|
make -C scanGoSrc/ goimports
|
||||||
|
|
||||||
redomod:
|
redomod:
|
||||||
rm -f go.*
|
rm -f go.*
|
||||||
|
|
|
@ -35,7 +35,7 @@ func (it *RepoIterator) Scan() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repo returns the current repo.
|
// Repo returns the current repo.
|
||||||
func (it *RepoIterator) Repo() *Repo {
|
func (it *RepoIterator) Next() *Repo {
|
||||||
if it.packs[it.index-1] == nil {
|
if it.packs[it.index-1] == nil {
|
||||||
for i, d := range it.packs {
|
for i, d := range it.packs {
|
||||||
fmt.Println("i =", i, d)
|
fmt.Println("i =", i, d)
|
||||||
|
@ -61,10 +61,10 @@ func (r *Repos) All() *RepoIterator {
|
||||||
return iterator
|
return iterator
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repos) SortByName() *RepoIterator {
|
func (r *Repos) SortByPath() *RepoIterator {
|
||||||
packs := r.selectAllRepo()
|
packs := r.selectAllRepo()
|
||||||
|
|
||||||
sort.Sort(RepoByName(packs))
|
sort.Sort(RepoByPath(packs))
|
||||||
|
|
||||||
iterator := NewRepoIterator(packs)
|
iterator := NewRepoIterator(packs)
|
||||||
return iterator
|
return iterator
|
||||||
|
@ -77,11 +77,11 @@ func (all *Repos) Len() int {
|
||||||
return len(all.Repos)
|
return len(all.Repos)
|
||||||
}
|
}
|
||||||
|
|
||||||
type RepoByName []*Repo
|
type RepoByPath []*Repo
|
||||||
|
|
||||||
func (a RepoByName) Len() int { return len(a) }
|
func (a RepoByPath) Len() int { return len(a) }
|
||||||
func (a RepoByName) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath }
|
func (a RepoByPath) 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) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||||
|
|
||||||
// safely returns a slice of pointers to the Repo protobufs
|
// safely returns a slice of pointers to the Repo protobufs
|
||||||
func (all *Repos) selectAllRepo() []*Repo {
|
func (all *Repos) selectAllRepo() []*Repo {
|
||||||
|
|
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
@ -12,14 +11,6 @@ import (
|
||||||
var VERSION string
|
var VERSION string
|
||||||
|
|
||||||
func main() {
|
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
|
var repos *gitpb.Repos
|
||||||
repos = new(gitpb.Repos)
|
repos = new(gitpb.Repos)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue