Oh, yeah, true. Thx a lot. BTW, I *found* the rule on what are to be escaped so that I can embed any arbitrary content as a JSON string:
*The following characters are reserved in JSON and must be properly escaped to be used in strings:* - Backspace is replaced with \b. - Form feed is replaced with \f. - Newline is replaced with \n. - Carriage return is replaced with \r. - Tab is replaced with \t. - Double quote is replaced with \" - Backslash is replaced with \\ Free Online JSON Escape / Unescape Tool - FreeFormatter.com <https://www.freeformatter.com/json-escape.html> https://www.freeformatter.com/json-escape.html On Monday, August 14, 2017 at 12:28:36 AM UTC-4, dja...@gmail.com wrote: > > may be it is by default ? > https://play.golang.org/p/e1mTTLt6zH > > On Monday, August 14, 2017 at 6:35:41 AM UTC+3, Tong Sun wrote: >> >> Has anyone done Go based JSON Escape/Unescape yet? >> >> I want to pass any arbitrary content as a JSON string: >> >> { >> "content": "my escaped strings {\n \"employees\": {\n >> \"employee\": [\n {\n \"id\": >> \"1\",..." >> } >> >> In order to pass a JSON string inside another JSON string in such a >>> scenario, you need to escape it (e.g. manually via JSON Escape/Unescape >>> <http://codebeautify.org/json-escape-unescape>). >> >> >> >> Is there a Go package ready-made for it somewhere? >> Else, what are to be escaped so that I can embed any arbitrary content as >> a JSON string? >> >> Thx >> >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.