优化
This commit is contained in:
parent
53e305e9d3
commit
e7fa1bf25d
@ -90,6 +90,10 @@ func InitCfg(cfgname string) {
|
||||
log.Debug("读取文件失败:%v", err)
|
||||
return
|
||||
}
|
||||
// 移除 BOM
|
||||
if len(byteValue) >= 3 && byteValue[0] == 0xEF && byteValue[1] == 0xBB && byteValue[2] == 0xBF {
|
||||
byteValue = byteValue[3:]
|
||||
}
|
||||
var data map[string]interface{}
|
||||
// 反序列化JSON数据
|
||||
err = json.Unmarshal(byteValue, &data)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user