diff --git a/scanGoSrc.go b/scanGoSrc.go index 4e41358..2d6fa76 100644 --- a/scanGoSrc.go +++ b/scanGoSrc.go @@ -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 diff --git a/structs.go b/structs.go index 55b3188..8adc488 100644 --- a/structs.go +++ b/structs.go @@ -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 +}