mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
12 lines
186 B
Go
12 lines
186 B
Go
package sys
|
|
|
|
import "runtime"
|
|
|
|
func DumpStack() string {
|
|
buf := make([]byte, 1024)
|
|
for runtime.Stack(buf, true) == cap(buf) {
|
|
buf = make([]byte, cap(buf)*2)
|
|
}
|
|
return string(buf)
|
|
}
|