优化json合并

This commit is contained in:
白茶清欢 2024-11-25 18:54:03 +08:00
parent 2d10d261da
commit cb92be844e

View File

@ -181,8 +181,14 @@ func (oj *ownJSON) MergeDataForMap(ignoreError bool, dataList ...any) (map[strin
}
for k, v := range itemRes {
if v == nil {
if _, exist := res[k]; !exist {
res[k] = v
}
} else {
res[k] = v
}
}
}
return res, nil
}