There's a 50% chance the receiver wants a string, in which case it would be
simpler to use scanner.Text().

-rob


On Wed, Aug 31, 2016 at 9:11 AM, Mateusz Czapliński <czapko...@gmail.com>
wrote:

>
>
> W dniu wtorek, 30 sierpnia 2016 05:30:48 UTC+2 użytkownik chri...@uber.com
> napisał:
>>
>> How to efficiently create a new []byte slice that's not shared?
>> The simple way I can think of is to []byte(string(bytes)).
>>
>
> Alternatively, I'd expect the following should work:
>
>   outChannel <- append([]byte(nil), scanner.Bytes()...)
>   // or:
>   outChannel <- append([]byte{}, scanner.Bytes()...)
>
> though as to efficiency, I can't say much.
>
> /M.
>
> --
> 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