From: qydysky Date: Mon, 14 Sep 2020 12:33:30 +0000 (+0800) Subject: 59 X-Git-Tag: v0.0.2~20 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=afade058e33d741e9c33106074e4f3964569304e;p=part%2F.git 59 --- diff --git a/Json.go b/Json.go index 196d0b6..f746a0d 100644 --- a/Json.go +++ b/Json.go @@ -59,6 +59,12 @@ func (*json) GetValFrom(Source interface{},key string)interface {}{ return jq.Find(key) } +func (*json) GetValFromS(Source string,key string)interface {}{ + var jq *gojsonq.JSONQ + jq = gojsonq.New().FromString(Source) + return jq.Find(key) +} + func (this *json) GetMultiValFrom(Source interface{},key []string) []interface{}{ var jq *gojsonq.JSONQ switch Source.(type) {