slogging through moving to protobuf

This commit is contained in:
Jeff Carr 2024-11-28 08:54:30 -06:00
parent 27d052f513
commit c2b7b3c14d
2 changed files with 13 additions and 14 deletions

View File

@ -5,7 +5,6 @@ import (
"path/filepath"
"strings"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@ -15,24 +14,20 @@ func (f *Forge) ScanGoSrc() (bool, error) {
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 {
if strings.HasPrefix(dir, f.goSrc) {
gopath := strings.TrimPrefix(dir, f.goSrc)
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 {
log.Info("init worked for", newr.GoPath)
}
} else {
log.Info("ScanGoSrc() bad:", dir)
log.Log(FORGEPBWARN, "ScanGoSrc() bad:", dir)
}
}
return true, err

View File

@ -8,3 +8,7 @@ type Forge struct {
Config *ForgeConfigs // config repos for readonly, private, etc
Repos *gitpb.Repos
}
func (f *Forge) GetGoSrc() string {
return f.goSrc
}