If you are using it in a fmt string (like your example), you can use the
'%q' formatting verb (like this example
<https://play.golang.org/p/HGYpsvX0SP>).



On Thu, Jan 5, 2017 at 11:45 AM bsr <bsr...@gmail.com> wrote:

Please see the example https://play.golang.org/p/SeG7oO5Us0

I am doing some javascript codegen and I want my values single quoted. so,
in the above example, I want the output to be


{ v: 'hello ... \n world'}


instead of

{ v: '"hello ... \n world"'}  or { v: "hello ... \n world"}

how can I do that?

thanks,
bsr.

-- 
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.

-- 
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.

Reply via email to