diff options
Diffstat (limited to 'goSrcFind.go')
| -rw-r--r-- | goSrcFind.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/goSrcFind.go b/goSrcFind.go index b19e858..e776cf0 100644 --- a/goSrcFind.go +++ b/goSrcFind.go @@ -53,6 +53,21 @@ func useGoSrc() (string, error) { return pwd, nil } +func (f *Forge) goWorkExists() bool { + var err error + workFilePath := filepath.Join(f.GetGoSrc(), "go.work") + if _, err = os.Stat(workFilePath); err == nil { + log.Info("f.goWorkExists() found", workFilePath) + return true + } else if !os.IsNotExist(err) { + log.Info("f.goWorkExists() missing", workFilePath) + return false + } + // probably false, but some other error + log.Info("f.goWorkExists() os.Stat() error", err, workFilePath) + return false +} + func digup(path string) (string, error) { for { workFilePath := filepath.Join(path, "go.work") |
