func GetGid() (gid uint64) {
    b := make([]byte, 64)
    b = b[:runtime.Stack(b, false)]
    b = bytes.TrimPrefix(b, []byte("goroutine "))
    b = b[:bytes.IndexByte(b, ' ')]
    n, err := strconv.ParseUint(string(b), 10, 64)
    if err != nil {
        panic(err)
    }
    return n
}

标签: none

评论已关闭