From 107a98ffe46ff0f0d0781e8ed5bbfff30a0c9567 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Thu, 20 Dec 2018 03:38:21 +0800 Subject: [PATCH] 213 --- parser_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parser_test.go b/parser_test.go index 0d92421..50d5369 100644 --- a/parser_test.go +++ b/parser_test.go @@ -45,13 +45,15 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) { spew.Dump(adlist) for _, data := range adlist { + + data = strings.Trim(data, "\"") + unq, _ := strconv.Unquote("\"" + data + "\"") + data = unq + var gv interface{} gjson.Unmarshal([]byte(data), &gv) log.Println(gv) - data = strings.Trim(data, "\"") - unq, _ := strconv.Unquote("\"" + data + "\"") - unq, _ = strconv.Unquote(unq) - data = unq + var v interface{} json.Unmarshal([]byte(data), &v) spew.Dump(v)