How to get the actual address of the method?

Hi!

  1. The “real” address is impossible to get, indeed you can only get one code pointer, the pointer to the code of the function in memory which is calculated once. A function can be split into one or more code fragments each of which has its own code pointer, right? And from what I see in the source Go code of runtime package the code pointer you get is the last assigned by the PC at runtime so…It’s impossible to detect a single unique method pointer when a function is split in memory into two or more code fragments. At least at this abstraction level I think…

This is a bit bad explained…

It returns the ptr yes, at least the last code pointer. It’s correct.