mirror of
https://github.com/octoleo/restic.git
synced 2024-11-12 00:06:35 +00:00
16 lines
223 B
Go
16 lines
223 B
Go
|
package debug
|
||
|
|
||
|
import "runtime"
|
||
|
|
||
|
func DumpStacktrace() string {
|
||
|
buf := make([]byte, 128*1024)
|
||
|
|
||
|
for {
|
||
|
l := runtime.Stack(buf, true)
|
||
|
if l < len(buf) {
|
||
|
return string(buf[:l])
|
||
|
}
|
||
|
buf = make([]byte, len(buf)*2)
|
||
|
}
|
||
|
}
|