优化json合并
This commit is contained in:
parent
2d10d261da
commit
cb92be844e
8
json.go
8
json.go
@ -181,7 +181,13 @@ func (oj *ownJSON) MergeDataForMap(ignoreError bool, dataList ...any) (map[strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range itemRes {
|
for k, v := range itemRes {
|
||||||
res[k] = v
|
if v == nil {
|
||||||
|
if _, exist := res[k]; !exist {
|
||||||
|
res[k] = v
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res[k] = v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user