go-mod-clean/exit.go

27 lines
446 B
Go
Raw Normal View History

2024-12-13 16:16:18 -06:00
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 {
2024-12-14 17:47:30 -06:00
if argv.Pure {
eraseGoMod(check)
}
2024-12-13 16:16:18 -06:00
}
os.Exit(-1)
}