From e5ef67bb47f9ed39cbb66e170ee5fdb30d78674f Mon Sep 17 00:00:00 2001 From: huangsimin Date: Thu, 20 Dec 2018 10:53:30 +0800 Subject: [PATCH] for test --- parser_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parser_test.go b/parser_test.go index 56d4b86..a60313d 100644 --- a/parser_test.go +++ b/parser_test.go @@ -43,16 +43,17 @@ func (tt *Toutiao) ToDoParser(adstring string) (presult string, err error) { } for _, data := range adlist { + label := data[0:10] log.Println("test json -----------------------") var v interface{} - // log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) + log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) data = strings.Trim(data, "\"") unq, _ := strconv.Unquote("\"" + data + "\"") - log.Println(gjson.Parse(data).Get("app").Exists()) + log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) data = unq - log.Println(gjson.Parse(data).Get("app").Exists()) + log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists()) result := gjson.Parse(data) // log.Println(result.String())