diff options
| author | Jeff Carr <[email protected]> | 2024-12-07 16:50:04 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-07 16:50:04 -0600 |
| commit | c08079fc2fba6d5dd65bc878e51dc59680f2de5e (patch) | |
| tree | 368d54529d4970afcdeafe12de74d165edb2fa08 /goSrcFind.go | |
| parent | 7f1f8d4028fada967beb484e30a336dfa30e6806 (diff) | |
deubgging auto go buildv0.0.27
Diffstat (limited to 'goSrcFind.go')
| -rw-r--r-- | goSrcFind.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/goSrcFind.go b/goSrcFind.go index 7393a35..b19e858 100644 --- a/goSrcFind.go +++ b/goSrcFind.go @@ -17,20 +17,26 @@ import ( // otherwise use ~/go/src func (f *Forge) findGoSrc() (string, error) { pwd, err := os.Getwd() + startpwd, _ := os.Getwd() if err == nil { + log.Info("forge.findGoSrc() trying digup", pwd, err) // Check for go.work in the current directory and then move up until root if pwd, err := digup(pwd); err == nil { - log.Info("using go.work file in directory", pwd) + log.Info("forge.findGoSrc() using go.work file in directory", pwd) f.goWork = true // found an existing go.work file // os.Chdir(pwd) return pwd, nil + } else { + log.Info("forge.digup() err", pwd, err) } + } else { + log.Info("forge.findGoSrc() os.Getwd()", pwd, err) } // there are no go.work files, resume the ~/go/src behavior from prior to golang 1.22 pwd, err = useGoSrc() - log.Info("using ~/go/src directory", pwd) + log.Info("forge.findGoSrc() 2 using ~/go/src directory", pwd, "start was", startpwd) return pwd, err } @@ -50,9 +56,12 @@ func useGoSrc() (string, error) { func digup(path string) (string, error) { for { workFilePath := filepath.Join(path, "go.work") + log.Info("digup trying", workFilePath) if _, err := os.Stat(workFilePath); err == nil { + log.Info("digup found", path) return path, nil // Found the go.work file } else if !os.IsNotExist(err) { + log.Info("forgepb.digup() failed", workFilePath, err) return "", err // An error other than not existing } |
