work/main.go
Patryk Hegenberg d8743e54c1
Some checks are pending
Go CI Pipeline / ci (push) Waiting to run
Release Builds / GoReleaser build (push) Successful in 1m4s
refactor: use slog instead of log
2025-06-11 22:41:48 +02:00

28 lines
458 B
Go

package main
import (
"fmt"
"log/slog"
"os"
)
func main() {
app, err := NewApp()
if err != nil {
slog.Error(fmt.Sprintf("Unable to setup application: %v", err))
os.Exit(1)
}
defer func() {
if err := app.Close(); err != nil {
slog.Error(fmt.Sprintf("Failed to close application resources: %v", err))
}
}()
if len(os.Args) > 1 {
if err := app.setupCommands().Execute(); err != nil {
os.Exit(1)
}
} else {
app.makeChoice()
}
}