适配EasyMap

This commit is contained in:
白茶清欢 2023-12-24 22:53:27 +08:00
parent a427bc63c5
commit d9aed3d800
3 changed files with 8 additions and 4 deletions

4
go.mod
View File

@ -5,8 +5,8 @@ go 1.21
toolchain go1.21.4
require (
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20230826152035-90f7ba59144a
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231123090055-0d2a068178aa
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20231224145141-489e31b07a71
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231224125439-01f39b6ea08d
git.zhangdeman.cn/zhangdeman/util v0.0.0-20231014142840-445c6407db92
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
)

4
go.sum
View File

@ -2,10 +2,14 @@ git.zhangdeman.cn/zhangdeman/consts v0.0.0-20230815040024-2b12dd51d19b h1:C7Kftn
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20230815040024-2b12dd51d19b/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k=
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20230826152035-90f7ba59144a h1:B37yGkb/ETYInbS3j5JR6lgXPsvGjKcY26fsIlSpKxA=
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20230826152035-90f7ba59144a/go.mod h1:l9S40lsDnTd/VAZjh1kmfYvz0B9z+7oT86pMQ/KurWo=
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20231224145141-489e31b07a71 h1:nvVSH+Ju8EmoPiPHTae5lxHo4kDjROYChs19Yayz+NY=
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20231224145141-489e31b07a71/go.mod h1:SrtvrQRdzt+8KfYzvosH++gWxo2ShPTzR1m3VQ6uX7U=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20230909065133-098dcddf1fca h1:CoazDbdGF/bKooOdbyW4R9bmu+i+XvymKuxNFEi/UCE=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20230909065133-098dcddf1fca/go.mod h1:AWyjclAKRM7HiUNzm2wKhYw+s4Jz7fg8YngN+PYdKNo=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231123090055-0d2a068178aa h1:l835yJ1Ja5JTCrt+FkW+IKMFalBXHHlRUvQmav2C7KA=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231123090055-0d2a068178aa/go.mod h1:w7kG4zyTJ1uPFaTWhze+OQuaUBINT2XnDxpyiM6ctc0=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231224125439-01f39b6ea08d h1:TV0BCQQewBEtLsv3i9gXkxLFd5A5bWBTiNd3D/I5o4Q=
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20231224125439-01f39b6ea08d/go.mod h1:w7kG4zyTJ1uPFaTWhze+OQuaUBINT2XnDxpyiM6ctc0=
git.zhangdeman.cn/zhangdeman/util v0.0.0-20230815042559-b34984be7444 h1:JVp575weLUX4sfhgjjxotJPxfHio7Ua8KHH3LMRRs2E=
git.zhangdeman.cn/zhangdeman/util v0.0.0-20230815042559-b34984be7444/go.mod h1:IqS3vAMyt1fVCWS7RqGeUw1EFnL/ruUMha45G2T+YNM=
git.zhangdeman.cn/zhangdeman/util v0.0.0-20231014142840-445c6407db92 h1:p1GVRYJc3NNoZeLs4CukitAbM3O/ALNq3l31cnbBQDM=

4
map.go
View File

@ -33,9 +33,9 @@ func EasyMap(mapData interface{}) Map {
// Date : 15:06 2023/8/10
func EasyMapWithError(mapData interface{}) (Map, error) {
if nil == mapData {
return easymap.NewNormal(true), nil
return easymap.NewNormal(), nil
}
m := easymap.NewNormal(true)
m := easymap.NewNormal()
reflectType := reflect.TypeOf(mapData)
if reflectType.Kind() != reflect.Map {
mapFormatData := make(map[string]interface{})