From 4f3932b86b7c57c840c35d9ddf4d1d47e0beae36 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Thu, 20 Dec 2018 03:49:05 +0800 Subject: [PATCH] 213 --- parser_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/parser_test.go b/parser_test.go index 243d68c..6e7f5de 100644 --- a/parser_test.go +++ b/parser_test.go @@ -49,11 +49,12 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) { data = strings.Trim(data, "\"") unq, _ := strconv.Unquote("\"" + data + "\"") data = unq - unq, _ = strconv.Unquote("\"" + data + "\"") - data = unq - var gv interface{} - gjson.Unmarshal([]byte(data), &gv) - spew.Dump(gv) + + result := gjson.Parse(data) + log.Println(result.String()) + if result.Get("app").Exists() { + log.Println("this is app") + } var v interface{} json.Unmarshal([]byte(data), &v)