aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaiTon2023-11-25 12:34:45 +0000
committerVaiTon2023-11-25 12:34:45 +0000
commit18df9f897cddb57720296437b7da065e1430c6ef (patch)
tree62613e417e0fdbfb30fcd52b7ca82ed4049dfc93
parentb903e12d6bb6b21d2af3326a6a5e8f40d2854138 (diff)
Move flags into its own var block
-rw-r--r--caronte.go14
1 files 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()