Closed nuzar closed 3 years ago
If we get a string field, the result string is escaped (with double quotes).
func main() { var data = `{ "a": "str", "b": 1, "c": [1,2,3.333333], "d": { "1": 1, "2": 2 } }` v, err := fastjson.Parse(data) if err != nil { log.Fatal(err) } log.Printf("a: '%s'", v.Get("a")) }
2021/07/20 12:15:25 a: '"str"'
How to avoid this behavior, to get an exactly "str" string?
use v.GetStringBytes("a")
If we get a string field, the result string is escaped (with double quotes).
2021/07/20 12:15:25 a: '"str"'
How to avoid this behavior, to get an exactly "str" string?