package utils import ( "bytes" "fmt" "runtime" "strconv" )
_/*_获取协程__ID*/ func GetGoroutineID() { 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) fmt.Println(n) }