summaryrefslogtreecommitdiff
path: root/exit.go
diff options
context:
space:
mode:
Diffstat (limited to 'exit.go')
-rw-r--r--exit.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/exit.go b/exit.go
new file mode 100644
index 0000000..4664fda
--- /dev/null
+++ b/exit.go
@@ -0,0 +1,24 @@
+package main
+
+import (
+ "os"
+
+ "go.wit.com/lib/protobuf/gitpb"
+ "go.wit.com/log"
+)
+
+func okExit(check *gitpb.Repo, msg string) {
+ log.Info("exit() go-mod-clean on", check.GetGoPath(), "ok")
+ log.DaemonMode(true)
+ log.Info(msg)
+ os.Exit(0)
+}
+
+func badExit(check *gitpb.Repo, err error) {
+ log.DaemonMode(true)
+ log.Info("go-mod-clean failed: ", err, forge.GetGoSrc())
+ if check != nil {
+ eraseGoMod(check)
+ }
+ os.Exit(-1)
+}