On Thu, Feb 9, 2017 at 4:16 PM, Sina Siadat <
sia...@gmail.com> wrote:
>
> One thing I still don't understand is the cases when go:linkname is needed.
> Why not just import that package, if the function is exported. Is it only
> used for accessing unexported functions?
Yes.
It's primarily a hack that lets certain functions live in the runtime
package, and access runtime internals, but still pretend that they are
unexported functions of some different package. Look for the uses of
go:linkname in the runtime package itself.
Ian