Use the //go:linkname directive to create a public alias for private runtime functions by linking a local name to the external package path.
Use the //go:linkname compiler directive to create a public alias for a private runtime function by specifying the local name and the full external path. Place this directive immediately before the function declaration in your source file, ensuring the external path matches the package and function name exactly.
//go:linkname runtime_arena_newArena runtime.arena_newArena
func runtime_arena_newArena() unsafe.Pointer
go:linkname is a special instruction for the Go compiler that lets your code call private functions inside the Go standard library or runtime. It works like creating a secret shortcut to a locked room, allowing you to access internal tools that aren't meant for public use. You typically use this when building advanced libraries that need to interact directly with the Go runtime's memory management or scheduling systems.