[go-nuts] Re: Go based JSON Escape/Unescape

2017-08-14 Thread Tong Sun
I've wrapped into a tool, and here is why I'm doing that... Usage https://github.com/go-jsonfile/jsonfiddle#usage-1 jsonfiddle esc will escape any arbitrary string so as to embed it as content of json string. This seems useless at first, but it actually allows you to embed any arbitrary file

[go-nuts] Re: Go based JSON Escape/Unescape

2017-08-13 Thread Tong Sun
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 re

[go-nuts] Re: Go based JSON Escape/Unescape

2017-08-13 Thread djadala
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