mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
improve ConfigFromMap function for ghttp.Server
This commit is contained in:
parent
0e62510c6f
commit
9e32d74c8c
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user