
All checks were successful
🧪 ✨ Unit Tests Workflow / 🔍 🐹 Go Tests (push) Successful in 1m5s
Reviewed-on: Siteworxpro/Go-Template#2 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
34 lines
787 B
Go
34 lines
787 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"gitea.siteworxpro.com/Siteworxpro/Go-Template/cmds"
|
|
"gitea.siteworxpro.com/Siteworxpro/Go-Template/logger"
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
"os"
|
|
)
|
|
|
|
const Version = "0.1"
|
|
|
|
func main() {
|
|
rootCmd := &cobra.Command{
|
|
Use: "Go-Template",
|
|
Short: "Go-Template is a simple template for Go applications",
|
|
Long: `Go-Template is a simple template for Go applications. It provides a basic structure for building Go applications with a focus on simplicity and ease of use.`,
|
|
Version: Version,
|
|
}
|
|
|
|
l := logger.NewLogger(log.DebugLevel)
|
|
rootCmd.SetContext(logger.NewContext(context.Background(), l))
|
|
|
|
rootCmd.AddCommand(cmds.ServerCommand())
|
|
err := rootCmd.Execute()
|
|
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
|
|
os.Exit(0)
|
|
}
|