diff options
author | VaiTon | 2023-11-25 12:34:45 +0000 |
---|---|---|
committer | VaiTon | 2023-11-25 12:34:45 +0000 |
commit | 18df9f897cddb57720296437b7da065e1430c6ef (patch) | |
tree | 62613e417e0fdbfb30fcd52b7ca82ed4049dfc93 | |
parent | b903e12d6bb6b21d2af3326a6a5e8f40d2854138 (diff) |
Move flags into its own var block
-rw-r--r-- | caronte.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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() |