Core

/app/cmd/entrypoint.go (411 B)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package cmd

import (
"os"

"{{{ .Package }}}/app"
"{{{ .Package }}}/app/lib/log"
)

func Entrypoint(bi *app.BuildInfo) {
logger, err := Run(bi)
if err != nil {
const msg = "exiting due to error"
if logger == nil {
println(log.Red.Add(err.Error())) //nolint:forbidigo
println(log.Red.Add(msg)) //nolint:forbidigo
} else {
logger.Error(err)
logger.Error(msg)
}
os.Exit(1)
}
}