This commit is contained in:
hahwu 2025-04-16 19:11:11 +08:00
parent 53e305e9d3
commit e7fa1bf25d

View File

@ -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)