Stack traces: Difference between revisions
Content deleted Content added
Adds Clojure solution |
|||
Line 680:
import (
"fmt"
"runtime
)
func main() {
n := runtime.Stack(stackTrace, true)
stackTrace = stackTrace[:n]
fmt.Printf("%s\n", stackTrace)
▲ stackTrace := debug.Stack()
fmt.Printf("(%d bytes)\n", len(stackTrace))
}</lang>
outputs:
<pre>
goroutine 16 [running]:
/tmpfs/gosandbox-efa5a722_5cfcad46_bebc14b4_0486dec5_bd9e34fc/prog.go:10 +0xa0
/home/foo/go/hg/src/pkg/runtime/386/asm.s:93 (0x8049b72)▼
goroutine 19 [runnable]:
/home/foo/go/hg/src/pkg/runtime/proc.c:149 (0x80531de)▼
runfinq()
goexit: runtime·goexit(void)▼
(227 bytes)▼
</pre>
|