Initial commit
This commit is contained in:
28
main.go
Normal file
28
main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/log"
|
||||
"github.com/samber/lo"
|
||||
"hub.cybercinch.nz/guisea/go-template/cmd"
|
||||
"hub.cybercinch.nz/guisea/go-template/internal/config"
|
||||
"hub.cybercinch.nz/guisea/go-template/internal/logger"
|
||||
"os"
|
||||
)
|
||||
|
||||
func handlePanic() {
|
||||
if err := recover(); err != nil {
|
||||
log.Error("crashed", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
defer handlePanic()
|
||||
|
||||
// prepare config and logs
|
||||
lo.Must0(config.Init())
|
||||
lo.Must0(logger.Init())
|
||||
|
||||
// run the app
|
||||
cmd.Execute()
|
||||
}
|
||||
Reference in New Issue
Block a user