From d69a4bec1040cf298c75967f4d329a5411077fad Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Mon, 28 Oct 2024 09:34:12 +0100 Subject: [PATCH] format: use group style variable declaration to define cli flags --- cmd/server/main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 67fba91..bb2eb2f 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -13,12 +13,15 @@ import ( "git.smsvc.net/pomodoro/GoTomato/pkg/models" ) +var ( + // Define CLI flags + listenAddress = flag.String("listenAddress", shared.DefaultServerConfig.ListenAddress, "IP address to listen on") + listenPort = flag.Int("listenPort", shared.DefaultServerConfig.ListenPort, "Port to listen on") + password = flag.String("password", "", "Control password for pomodoro session (optional)") + showVersionFlag = flag.Bool("version", false, "Output version") +) + func Start() { - // Define CLI flags for ListenAddress and ListenPort - listenAddress := flag.String("listenAddress", shared.DefaultServerConfig.ListenAddress, "IP address to listen on") - listenPort := flag.Int("listenPort", shared.DefaultServerConfig.ListenPort, "Port to listen on") - password := flag.String("password", "", "Control password for pomodoro session (optional)") - showVersionFlag := flag.Bool("version", false, "Output version") flag.Parse() if *showVersionFlag {