1 Star 0 Fork 0

码布什 / go工具库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
RuntimeUtil.go 274 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhengqiuyun 提交于 2023-02-21 16:29 . Init git
package util
import (
"bytes"
"runtime"
"strconv"
)
func GetGID() uint64 {
b := make([]byte, 64)
b = b[:runtime.Stack(b, false)]
b = bytes.TrimPrefix(b, []byte("goroutine "))
b = b[:bytes.IndexByte(b, ' ')]
n, _ := strconv.ParseUint(string(b), 10, 64)
return n
}
Go
1
https://gitee.com/manoshi/go-util.git
git@gitee.com:manoshi/go-util.git
manoshi
go-util
go工具库
v0.1.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891