From ce86a2362206944f9d6a881fae19790931770301 Mon Sep 17 00:00:00 2001 From: Kevin Fries Date: Fri, 16 Aug 2024 21:32:22 -0600 Subject: [PATCH] added main routine for go apps --- main.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..2813f34 --- /dev/null +++ b/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + + . "git.kevinfries.com/kfries63/config" + . "git.kevinfries.com/kfries63/logger" +} + +func init() { + SetAppName("Hello World", "hw") + SetAppVersion("0.1.0") + + DefineConfigItem("Debug", "D", false, "Trun on debug mode") + SetLogger(Debug) +} + +func DebugHandler() { + if Config.GetBool("Debug") { + SetLogger(Debug) + } +} + +func main*() { + GetConfigs() + DebugHandler() + + fmt.Println("Hello World!!") +} +