Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Caller ¶
Example ¶
package main
import (
"fmt"
"github.com/foomo/go/runtime"
)
func main() {
shortName, fullName, file, line, ok := runtime.Caller(0)
fmt.Println(shortName)
fmt.Println(fullName)
fmt.Println(file)
fmt.Println(line)
fmt.Println(ok)
}
Output: runtime_test.ExampleCaller github.com/foomo/go/runtime_test.ExampleCaller runtime/caller_test.go 18 true
func StackTrace ¶
StackTrace captures and formats a stack trace up to the specified number of frames, skipping the given number of initial frames.
Example ¶
package main
import (
"fmt"
"github.com/foomo/go/runtime"
)
func main() {
stack := runtime.StackTrace(2, 0)
fmt.Println(stack)
}
Output: github.com/foomo/go/runtime_test.ExampleStackTrace runtime/stacktrace_test.go:13 testing.runExample testing/run_example.go:63
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.