目录

runtimex

Runtimex package help to expose Go Runtime internals representation safely.

Usage

Get Goroutine ID

gid, err := runtimex.GID()

Get Processor ID

pid, err := runtimex.PID()

Note

Since we use a hack way to expose internal representation of the Go runtime, so if Go change some internal variable names, the package will return error.

You should care about the error returned by runtimex and do the fallback logic If necessary.

For now, we only depend on runtime.g and g.goid.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号