for test
This commit is contained in:
parent
b4bd32c0a2
commit
4fddfe2863
|
@ -47,13 +47,13 @@ func (tt *Toutiao) ToDoParser(adstring string) (presult string, err error) {
|
|||
log.Println("test json -----------------------")
|
||||
var v interface{}
|
||||
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).IsObject())
|
||||
|
||||
data = strings.Trim(data, "\"")
|
||||
unq, _ := strconv.Unquote("\"" + data + "\"")
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).IsObject())
|
||||
data = unq
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
|
||||
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).IsObject())
|
||||
|
||||
result := gjson.Parse(data)
|
||||
// log.Println(result.String())
|
||||
|
|
Loading…
Reference in New Issue
Block a user