On Fri, Sep 30, 2016 at 11:38 AM, Luis Furquim <
luisf...@gmail.com> wrote:
>
> I need to have a list of registered functions. I want to control if a
> function is already registered and, if so, just ignore any new registration
> of that function. My idea was to use the function's adress as the key of
> registered functions. So, to get the address of a function I just do this:
> x := fmt.Sprintf("%#v",funcToRegister)
> x = x[11:len(x)-1]
>
> My question is: does the function address may change (relocation) over time?
In the current implementation, the address of a regular top-level
function (not a function closure defined within a function) will not
change while the program is running. However, this is not guaranteed
by the language, and can imagine other implementations in which that
is not true.
Ian