View definition


Defined in


RelString returns the full name of this function, qualified by package name, receiver type, etc.

The specific formatting rules are not guaranteed and may change.


"math.IsNaN"                  // a package-level function
"(*bytes.Buffer).Bytes"       // a declared method or a wrapper
"(*bytes.Buffer).Bytes$thunk" // thunk (func wrapping method; receiver is param 0)
"(*bytes.Buffer).Bytes$bound" // bound (func wrapping method; receiver supplied by closure)
"main.main$1"                 // an anonymous function in main
"main.init#1"                 // a declared init function
"main.init"                   // the synthesized package initializer

When these functions are referred to from within the same package (i.e. from == f.Pkg.Object), they are rendered without the package path. For example: "IsNaN", "(*Buffer).Bytes", etc.

All non-synthetic functions have distinct package-qualified names. (But two methods may have the same name "(T).f" if one is a synthetic wrapper promoting a non-exported method "f" from another package; in that case, the strings are equal but the identifiers "f" are distinct.)