format: use group style variable declaration to define cli flags

This commit is contained in:
Sebastian Mark 2024-10-28 09:34:12 +01:00
parent e2ab19066d
commit d69a4bec10

View file

@ -13,12 +13,15 @@ import (
"git.smsvc.net/pomodoro/GoTomato/pkg/models" "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() { 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() flag.Parse()
if *showVersionFlag { if *showVersionFlag {