Created
April 25, 2023 14:44
-
-
Save huantt/82f12eaa40a41d80fe3775dc0398b53e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment