Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -2,13 +2,13 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// to print it to standard error
|
||||
debug.PrintStack()
|
||||
// alternately to get it in a variable:
|
||||
stackTrace := debug.Stack()
|
||||
stackTrace := make([]byte, 1024)
|
||||
n := runtime.Stack(stackTrace, true)
|
||||
stackTrace = stackTrace[:n]
|
||||
fmt.Printf("%s\n", stackTrace)
|
||||
fmt.Printf("(%d bytes)\n", len(stackTrace))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue