diff --git a/internal/config/database.go b/internal/config/database.go index 1afc32d1e..e816ba772 100644 --- a/internal/config/database.go +++ b/internal/config/database.go @@ -30,11 +30,14 @@ func (*Database) Init(prefix ...string) *Database { } p := func(s string) string { - return prefix[0] + "-" + s + if len(prefix) > 0 { + return prefix[0] + "-" + s + } + return s } db = new(Database) - flag.StringVar(&db.DSN, p("db-dsn"), "crust:crust@tcp(db1:3306)/crust?collation=utf8mb4_general_ci", "DSN for database connection") + flag.StringVar(&db.DSN, p("db-dsn"), "", "DSN for database connection (e.g. user:pass@tcp(db1:3306)/dbname?collation=utf8mb4_general_ci)") flag.StringVar(&db.Profiler, p("db-profiler"), "", "Profiler for DB queries (none, stdout)") return db } diff --git a/internal/config/http.go b/internal/config/http.go index 2369fb91f..04063f1b7 100644 --- a/internal/config/http.go +++ b/internal/config/http.go @@ -38,7 +38,10 @@ func (*HTTP) Init(prefix ...string) *HTTP { } p := func(s string) string { - return prefix[0] + "-" + s + if len(prefix) > 0 { + return prefix[0] + "-" + s + } + return s } http = new(HTTP)