From 5efbdca966b1bc94aa78806a859f113aa6a6e8bb Mon Sep 17 00:00:00 2001 From: Damon To Date: Sat, 4 May 2024 13:15:41 +0800 Subject: [PATCH] chore: refactor main.go for better code organization --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index e7be12f..e0009d1 100644 --- a/main.go +++ b/main.go @@ -24,10 +24,8 @@ func init() { flag.Parse() } -func main() { - slog.Info("eSTK.me cloud enhance server", "version", Version) +func initApp() { config.C.LoadEnv() - if config.C.Verbose { slog.SetLogLoggerLevel(slog.LevelDebug) slog.Warn("verbose mode is enabled, this will print out sensitive information") @@ -44,6 +42,11 @@ func main() { os.Exit(1) } } +} + +func main() { + slog.Info("eSTK.me cloud enhance server", "version", Version) + initApp() manager := cloud.NewManager() server := cloud.NewServer(manager)