remove : Prot default value removal

This commit is contained in:
zhangwenjian
2020-07-29 23:31:51 +08:00
parent 59e966ede6
commit 061cb61aa7
+2 -11
View File
@@ -19,7 +19,7 @@ func InitApplication(cfg *viper.Viper) *Application {
ReadTimeout: cfg.GetInt("readTimeout"),
WriterTimeout: cfg.GetInt("writerTimeout"),
Host: cfg.GetString("host"),
Port: portDefault(cfg),
Port: cfg.GetString("port"),
Name: cfg.GetString("name"),
JwtSecret: cfg.GetString("jwtSecret"),
Mode: cfg.GetString("mode"),
@@ -28,13 +28,4 @@ func InitApplication(cfg *viper.Viper) *Application {
}
}
var ApplicationConfig = new(Application)
func portDefault(cfg *viper.Viper) string {
if cfg.GetString("port") == "" {
return "8000"
} else {
return cfg.GetString("port")
}
}
var ApplicationConfig = new(Application)