slogging through moving to protobuf
This commit is contained in:
parent
27d052f513
commit
c2b7b3c14d
23
scanGoSrc.go
23
scanGoSrc.go
|
@ -5,7 +5,6 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,24 +14,20 @@ func (f *Forge) ScanGoSrc() (bool, error) {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var repos *gitpb.Repos
|
|
||||||
repos = new(gitpb.Repos)
|
|
||||||
|
|
||||||
newr, err := repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/wit-package")
|
|
||||||
if err != nil {
|
|
||||||
log.Info("init failed", err)
|
|
||||||
panic("crapnuts")
|
|
||||||
} else {
|
|
||||||
log.Info("init worked for", newr.GoPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, dir := range dirs {
|
for _, dir := range dirs {
|
||||||
if strings.HasPrefix(dir, f.goSrc) {
|
if strings.HasPrefix(dir, f.goSrc) {
|
||||||
gopath := strings.TrimPrefix(dir, f.goSrc)
|
gopath := strings.TrimPrefix(dir, f.goSrc)
|
||||||
gopath = strings.Trim(gopath, "/")
|
gopath = strings.Trim(gopath, "/")
|
||||||
log.Info("ScanGoSrc() ok:", f.goSrc, gopath)
|
// log.Info("ScanGoSrc() ok:", f.goSrc, gopath)
|
||||||
|
newr, err := f.Repos.NewGoPath(f.goSrc, gopath)
|
||||||
|
if err != nil {
|
||||||
|
log.Log(FORGEPBWARN, "init failed", err)
|
||||||
|
panic("crapnuts")
|
||||||
} else {
|
} else {
|
||||||
log.Info("ScanGoSrc() bad:", dir)
|
log.Info("init worked for", newr.GoPath)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Log(FORGEPBWARN, "ScanGoSrc() bad:", dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true, err
|
return true, err
|
||||||
|
|
|
@ -8,3 +8,7 @@ type Forge struct {
|
||||||
Config *ForgeConfigs // config repos for readonly, private, etc
|
Config *ForgeConfigs // config repos for readonly, private, etc
|
||||||
Repos *gitpb.Repos
|
Repos *gitpb.Repos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *Forge) GetGoSrc() string {
|
||||||
|
return f.goSrc
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue