From 18df9f897cddb57720296437b7da065e1430c6ef Mon Sep 17 00:00:00 2001 From: VaiTon Date: Sat, 25 Nov 2023 13:34:45 +0100 Subject: Move flags into its own var block --- caronte.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/caronte.go b/caronte.go index da65e9b..039694c 100644 --- a/caronte.go +++ b/caronte.go @@ -26,13 +26,15 @@ import ( var Version string -func main() { - mongoHost := flag.String("mongo-host", "localhost", "address of MongoDB") - mongoPort := flag.Int("mongo-port", 27017, "port of MongoDB") - dbName := flag.String("db-name", "caronte", "name of database to use") +var ( + mongoHost = flag.String("mongo-host", "localhost", "address of MongoDB") + mongoPort = flag.Int("mongo-port", 27017, "port of MongoDB") + dbName = flag.String("db-name", "caronte", "name of database to use") + bindAddress = flag.String("bind-address", "0.0.0.0", "address where server is bind") + bindPort = flag.Int("bind-port", 3333, "port where server is bind") +) - bindAddress := flag.String("bind-address", "0.0.0.0", "address where server is bind") - bindPort := flag.Int("bind-port", 3333, "port where server is bind") +func main() { flag.Parse() -- cgit v1.2.3-70-g09d2