On Mon, Dec 23, 2019 at 2:49 PM <ju...@sqreen.io> wrote: > 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 Note that while you can a pointer to a function, you rarely need that. Function is just a value like int (in the very first approximation). > My main reason for willing this is to be able to: > - atomically load a dynamic address. Depends very much on what a "dynamic address" is. Functions are normally static. Functions literals a bit less, but actually the code address is always fixed in both cases, only the closure parameter, if any, differs. -- 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/CAA40n-Wj58nGdC2Mr4Z8gdFCH1O3Z3u9Fa0zx_9eeSh7Or7%3D7Q%40mail.gmail.com.