summaryrefslogtreecommitdiff
path: root/goWork.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-01 12:15:41 -0500
committerJeff Carr <[email protected]>2025-11-01 12:15:41 -0500
commit6fa3221e265933038342acb50caad3c2bbb6c136 (patch)
treebe67bef75b839221c6af324a755dc5bf29c81e5c /goWork.go
parent750a486170538b546d52f7e666b01ccf82fba653 (diff)
test making go.work filesHEADv0.0.197master
Diffstat (limited to 'goWork.go')
-rw-r--r--goWork.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/goWork.go b/goWork.go
index 0c8fe4e..d947df7 100644
--- a/goWork.go
+++ b/goWork.go
@@ -3,22 +3,16 @@
package forgepb
import (
- "errors"
"fmt"
"os"
"path/filepath"
+
+ "go.wit.com/lib/env"
)
// very much a hack job
func (f *Forge) MakeGoWork() error {
- if f.IsGoWork() {
- // a go.work file was found
- } else {
- // you can use a go.work file in ~/go/src , but you probably shouldn't unless something
- // has gone terribly wrong
- return errors.New("if you want a go.work file in ~/go/src/, touch it first")
- }
- filename := filepath.Join(getClonePathFromMode(), "go.work")
+ filename := filepath.Join(env.Get("gopath"), "go.work")
workf, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
return err