tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
14.1k stars 846 forks source link

Has a way to escape all character? #251

Open itmaple opened 2 years ago

itmaple commented 2 years ago

I have a string x.x.x, if escape , I need to change it to x\.x\.x. I think it can escape all character like this $x.x.x$ sjson can also support this syntax.

goshlanguage commented 2 years ago

You can see information on escape characters for gjson here: https://github.com/tidwall/gjson/blob/master/SYNTAX.md#escape-character

itmaple commented 2 years ago

Only one character escape. Sometime I need a raw string.

tidwall commented 2 years ago

Perhaps having a utility function, like EscapePath might be useful?

itmaple commented 2 years ago

Like this, or a modifier @raw:""