all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
14
Task/Stack-traces/Go/stack-traces.go
Normal file
14
Task/Stack-traces/Go/stack-traces.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// to print it to standard error
|
||||
debug.PrintStack()
|
||||
// alternately to get it in a variable:
|
||||
stackTrace := debug.Stack()
|
||||
fmt.Printf("(%d bytes)\n", len(stackTrace))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue