amocrm/template/cmd/{{.ProjectName}}/main.go.tmpl

29 lines
598 B
Cheetah
Raw Normal View History

2024-04-04 09:42:40 +00:00
package main
import (
"context"
"os/signal"
"syscall"
"{{.Vars.ProjectName}}/internal/app"
"{{.Modules.logger.Import}}"
"{{.Modules.logger.ImportCore}}"
"{{.Modules.env.Import}}"
)
func main() {
{{.Modules.logger.Declaration "logger"}}
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
var config app.Config
{{.Modules.env.Declaration "config"}}
if err := app.Run(ctx, config, logger); err != nil {
{{.Modules.logger.Message "Fatal" "Failed to run app" "Error" "err"}}
}
}