improve ConfigFromMap function for ghttp.Server

This commit is contained in:
John 2019-11-06 20:23:41 +08:00
parent 0e62510c6f
commit 9e32d74c8c

View File

@ -118,7 +118,9 @@ func Config() ServerConfig {
// 通过Map创建Config配置对象Map没有传递的属性将会使用模块的默认值
func ConfigFromMap(m map[string]interface{}) ServerConfig {
config := defaultServerConfig
gconv.Struct(m, &config)
if err := gconv.Struct(m, &config); err != nil {
panic(err)
}
return config
}