remove : Prot default value removal
This commit is contained in:
1 parent
59e966ede6
commit
061cb61aa7
1 file changed
+1
-10
@@ -19,7 +19,7 @@ func InitApplication(cfg *viper.Viper) *Application {
|
|||||||
ReadTimeout: cfg.GetInt("readTimeout"),
|
ReadTimeout: cfg.GetInt("readTimeout"),
|
||||||
WriterTimeout: cfg.GetInt("writerTimeout"),
|
WriterTimeout: cfg.GetInt("writerTimeout"),
|
||||||
Host: cfg.GetString("host"),
|
Host: cfg.GetString("host"),
|
||||||
Port: portDefault(cfg),
|
Port: cfg.GetString("port"),
|
||||||
Name: cfg.GetString("name"),
|
Name: cfg.GetString("name"),
|
||||||
JwtSecret: cfg.GetString("jwtSecret"),
|
JwtSecret: cfg.GetString("jwtSecret"),
|
||||||
Mode: cfg.GetString("mode"),
|
Mode: cfg.GetString("mode"),
|
||||||
@@ -29,12 +29,3 @@ func InitApplication(cfg *viper.Viper) *Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ApplicationConfig = new(Application)
|
var ApplicationConfig = new(Application)
|
||||||
|
|
||||||
func portDefault(cfg *viper.Viper) string {
|
|
||||||
if cfg.GetString("port") == "" {
|
|
||||||
return "8000"
|
|
||||||
} else {
|
|
||||||
return cfg.GetString("port")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in new issue
Block a user