gjson+sjson hack升级 #8
@@ -321,6 +321,20 @@ func Get(gjsonResult gjson.Result, path string) gjson.Result {
|
|||||||
return gjsonResult
|
return gjsonResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMany 兼容 gjson GetMany 方法
|
||||||
|
//
|
||||||
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
//
|
||||||
|
// Date : 16:32 2024/12/5
|
||||||
|
func GetMany(jsonStr string, pathList ...string) []gjson.Result {
|
||||||
|
res := make([]gjson.Result, 0)
|
||||||
|
gjsonResult := gjson.Parse(jsonStr)
|
||||||
|
for _, itemPath := range pathList {
|
||||||
|
res = append(res, Get(gjsonResult, itemPath))
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
// IsSpecialPath 判断传入的是否为特殊路径
|
// IsSpecialPath 判断传入的是否为特殊路径
|
||||||
//
|
//
|
||||||
// Author : go_developer@163.com<白茶清欢>
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
|||||||
Reference in New Issue
Block a user