[go-nuts] Re: Function to escape and unscape string

2021-09-05 Thread jake...@gmail.com
On Sunday, September 5, 2021 at 12:56:07 AM UTC-4 tapi...@gmail.com wrote:

> This is a known problem: https://github.com/golang/go/issues/8618
> I looks the root cause is reflect.TypeOf and ValueOf make the values 
> referenced by the arguments escape, though often this is over-cautious.
>

I think you misunderstood the problem. The question  has to do with 
character escaping in strings, not memory escaping to the heap.

Of course we don't actually know what the problem the OP is having with 
escaping strings, because the original post is vague.  

On Sunday, August 29, 2021 at 3:02:42 PM UTC-4 nadashin wrote:
>
>> fmt.Printf has a format specifier, %q that escapes string with Go 
>> syntax and add quotes around the string. ( %#v also does it) 
>>
>> But it doesn't have one that unescapes a string. 
>>
>> I couldn't find any stdlib function that escape and unescape a string 
>> following Go syntax. (and doesn't add quotes around the string) 
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f68eaf4e-341e-485e-80a8-8e7c91970969n%40googlegroups.com.


[go-nuts] Re: Function to escape and unscape string

2021-09-04 Thread tapi...@gmail.com
This is a known problem: https://github.com/golang/go/issues/8618
I looks the root cause is reflect.TypeOf and ValueOf make the values 
referenced by the arguments escape, though often this is over-cautious.

On Sunday, August 29, 2021 at 3:02:42 PM UTC-4 nadashin wrote:

> fmt.Printf has a format specifier, %q that escapes string with Go
> syntax and add quotes around the string. ( %#v also does it)
>
> But it doesn't have one that unescapes a string.
>
> I couldn't find any stdlib function that escape and unescape a string
> following Go syntax. (and doesn't add quotes around the string)
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0b860574-4075-43c1-a419-b1192ba4c3b0n%40googlegroups.com.


[go-nuts] Re: Function to escape and unscape string

2021-08-29 Thread 'nadashin' via golang-nuts
> I couldn't find any stdlib function that escape and unescape a string
> following Go syntax. (and doesn't add quotes around the string)

If the stdlib doesn't have such functions I am proposing to add them.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/xwIbVnMN90hQRfEyPXG9LHqip6wJMSJtGT3pQJONZAD_G-0B2CWJ54VmZcuP48b9BzctwYdVhL4XL1JxP8HTxU4qsqzrAAWPeL2IEk1Hq5c%3D%40protonmail.com.