package main import ( "context" "fmt" "os" "go.uber.org/fx" "git.dcentral.systems/toolz/goplt/internal/di" "git.dcentral.systems/toolz/goplt/pkg/logger" ) func main() { // Create DI container with lifecycle hooks container := di.NewContainer( // Invoke lifecycle hooks fx.Invoke(di.RegisterLifecycleHooks), ) // Create root context ctx := context.Background() // Start the application if err := container.Start(ctx); err != nil { log := logger.GetGlobalLogger() if log != nil { log.Error("Failed to start application", logger.Error(err), ) } else { fmt.Fprintf(os.Stderr, "Failed to start application: %v\n", err) } os.Exit(1) } }