diff options
| author | Jeff Carr <[email protected]> | 2025-11-01 12:15:23 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-11-01 12:15:23 -0500 |
| commit | 8c1eea72a59ea1d75b6e781f4bc87e328f6336a7 (patch) | |
| tree | 9a0b6396fc48859bc87d97b3d78d34537d5561c6 /doGoWork.go | |
| parent | e1a3c160a5b13ff874df75938cbe62e81bef1ec2 (diff) | |
Diffstat (limited to 'doGoWork.go')
| -rw-r--r-- | doGoWork.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doGoWork.go b/doGoWork.go new file mode 100644 index 0000000..ca17006 --- /dev/null +++ b/doGoWork.go @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "path/filepath" + + "go.wit.com/lib/env" + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + +func doGoWork() (string, error) { + if env.True("GoWork") { + s := fmt.Sprintf("Creating %s", filepath.Join(env.Get("gopath"), "go.work")) + shell.PathRun(env.Get("gopath"), []string{"mv", "go.work", "go.work.last"}) + err := me.forge.MakeGoWork() + shell.PathRun(env.Get("gopath"), []string{"go", "work", "use"}) + log.Info("") + log.Info("original go.work file saved as go.work.last") + log.Info("") + return s, err + } + return "Not working with a go.work file", nil +} |
