This commit is contained in:
eson
2023-09-22 13:14:53 +08:00
parent 8b81308bd2
commit b1675ae0bf
3 changed files with 12 additions and 1 deletions

View File

@@ -248,11 +248,15 @@ func GetMapValueByKey(info map[string]interface{}, keys []string) (interface{},
for _, k := range keys {
if cur, ok := info[k]; ok {
if curMap, ok := cur.(map[string]interface{}); ok {
info = curMap
} else if curMap, ok := cur.(interface{}); ok {
return curMap, nil
} else {
return nil, fmt.Errorf("curMap keys is not exists %#v", keys)
}
} else {
return nil, fmt.Errorf("info keys is not exists %#v", keys)
}