From f550fff92a1ce8f4864ee57923dc29a891afcd6f Mon Sep 17 00:00:00 2001 From: huangsimin Date: Thu, 20 Dec 2018 10:32:56 +0800 Subject: [PATCH] for test --- parser_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser_test.go b/parser_test.go index 769b3c7..63f9410 100644 --- a/parser_test.go +++ b/parser_test.go @@ -43,13 +43,13 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) { for _, data := range adlist { var v interface{} - log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists()) + log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) data = strings.Trim(data, "\"") unq, _ := strconv.Unquote("\"" + data + "\"") - log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists()) + log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) data = unq - log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists()) + log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) result := gjson.Parse(data) log.Println(result.String())