If what you want is a) assume that a `func()` is pointer-shaped and b) treat it as an unsafe.Pointer for use with atomics, then that's a problem that - as all problems in computer science - can be solved with another layer of indirection:
https://play.golang.org/p/o0DvCxPTG1OAs Jan mentioned, a `func()`-value (disclaimer: as implemented by gc currently) is not the actual code-address. But this still lets you move between `func()` and `unsafe.Pointer`.
However, I feel compelled to point out that assumption a) is not in general true. It *does* hold in the current implementation of gc on common architectures, but I don't know if it's true for gccgo, I wouldn't be surprised if it isn't true for GopherJS or on wasm and someone recently told me that it's not true for tinygo. It's also, as far as I can tell, not covered by the rules for unsafe.Pointer:
https://golang.org/pkg/unsafe/#PointerSo while I *think* it will work as expected, there is no guarantee that it will continue to do so.
So, in conclusion: If you do that, then when it will break, it will do so non-deterministically, with a confusing failure mode and only when you're not looking ;) I strongly advise you against it and treat the memory layout of func() as the opaque implementation detail that it is intended to be. And just use sync.Value if you need to operate on it with atomics.