Is there a tool in the official tooling or the third party tool that lets you list all your running goroutines that are running with your main program?
Or something like the observer in Erlang/Elixir?
Is there a tool in the official tooling or the third party tool that lets you list all your running goroutines that are running with your main program?
Or something like the observer in Erlang/Elixir?
To get a stack trace of all goroutines:
You can use runtime.Stack()
with all
set to true
:
func Stack(buf []byte, all bool) int
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.