Aug 23, 2019

[Go] print out stack trace at runtime

runtime.Stack(buf, true)
Stack formats a stack trace of the calling goroutine into buf and returns the number of bytes written to buf.
If all is true, Stack formats stack traces of all other goroutines into buf after the trace for the current goroutine.


$ go doc -src runtime.Stack
$ go doc runtime.Stack

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.