Have you tried examining the assembler output?  go build -gcflags="-S" 
program.go if I recall correctly. 


On Wednesday, August 3, 2016 at 11:27:36 AM UTC-4, T L wrote:
>
>
> I know a string value can be used as []byte if the first parameter if the 
> builtin copy/append function is a []byte value:
>
>> var bs []byte = make([]byte, 10)
>> copy(bs, "abcde")
>
>
> but if do explicit conversion anyway on the second string value  
>
>> var bs []byte = make([]byte, 10)
>> copy(bs, []byte("abcde"))
>>
> will compiler do optimization here to avoid copying the underline byte 
> array of 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to