> > But I cannot find any way of assigning a value to the function pointer 
> `f` even using the `unsafe` package. 
>
> https://play.golang.org/p/qP5kuSCW6dO 
>

Thanks, unfortunately the asm shows that what gets into `f` is the stack 
address of `f0` and not the address of the function:

LEAQ    "".foo·f(SB), DX
MOVQ    DX, "".f0(SP) // f0 = foo
MOVQ    "".f0(SP), DX // f = &f0
MOVQ    (DX), AX // *f

I'd love to find how to directly use the address without any local variable 
:-)

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3ac144bc-7d4c-4400-945a-33d2163780cd%40googlegroups.com.

Reply via email to