summaryrefslogtreecommitdiff
path: root/exit.go
blob: 0f34ce318b5ce9b111be5e0372d0d031bb346fa9 (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
25
26
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 {
		if argv.Pure {
			eraseGoMod(check)
		}
	}
	os.Exit(-1)
}