Maybe an artifact of the C to Go automatic translation tool.

> On Feb 25, 2020, at 5:29 PM, 'Keith Randall' via golang-nuts 
> <golang-nuts@googlegroups.com> wrote:
> 
> 
> 
> On Tuesday, February 25, 2020 at 4:10:46 AM UTC-8 dmitry....@jetbrains.com 
> wrote:
> What is the meaning of the conversion
> 
>     var b []byte
>     var p *byte = (*byte)(unsafe.Pointer(*b[0]))
> 
> You mean &b[0] at the end there, not *b[0].
>  
> 
> It is used for example in 
> https://github.com/golang/net/blob/master/internal/socket/iovec_64bit.go 
> <https://github.com/golang/net/blob/master/internal/socket/iovec_64bit.go>.
> 
> How it is different from
> 
>     var b []byte
>     var p *byte = &b[0]
> 
> 
> It is not any different. Not sure why the code goes through that hoop 
> unnecessarily.
> Probably historical accident. Maybe go through the change history and see how 
> it evolved.
>  
> Thank you!
> 
> 
> -- 
> 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 
> <mailto:golang-nuts+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/68ad8286-1bcf-4706-ad4c-f33147387c2e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/68ad8286-1bcf-4706-ad4c-f33147387c2e%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/3524F563-40BD-4FAA-B1FC-6CD84E9AF564%40ix.netcom.com.

Reply via email to