summaryrefslogtreecommitdiff
path: root/exit.go
blob: 4664fdaf7d0ca0d261fcaa312c95c6781101c501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
}