diff options
author | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-08-18 13:29:54 +0300 |
---|---|---|
committer | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-08-18 13:29:54 +0300 |
commit | fd70f95224374d23157ee7c0357733102cd0df53 (patch) | |
tree | e490c12e021cedaf211b292d5d623baa32a673fc /main.go |
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +package main + +import ( + "context" + "log/slog" + "os" + "os/signal" + + "gitrepo.ru/neonxp/track/pkg/app" +) + +func main() { + ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) + defer cancel() + + if err := app.App(ctx); err != nil { + slog.ErrorContext(ctx, "error", slog.Any("error", err)) + os.Exit(1) + } + +} |