This package used to report the calling function's name as cheaply as possible, but has rotted over time due to depending on internal unstable details. It used to have assembly implementations to get the caller pc very cheaply, but I got spooked by my handling of pointers inside of some assembly routines (it used to assume all the pointers were to readonly data, but that may not be the case depending on some internal details). So now it just has some wrappers around runtime.Callers and runtime.FuncForPC and provides no special speedups.
zeebo / this Goto Github PK
View Code? Open in Web Editor NEWThis returns the name of the calling function/package with no allocations.
License: MIT License