diff options
| author | Jeff Carr <[email protected]> | 2024-12-10 01:48:29 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-10 01:48:29 -0600 |
| commit | 757fd9ba55ff84f088e4cb037ea0a49b7f4211d0 (patch) | |
| tree | 9636624294e9b4d50c13e9a4c8bad9f6f9a08e81 /goSrcFind.go | |
| parent | c08079fc2fba6d5dd65bc878e51dc59680f2de5e (diff) | |
go.work file fixes
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") |
