thanks for replay, you said right, i have changed the code, its works fine,
thank you, here is code:
package main
import (
"fmt"
"runtime"
)
func test() {
var zero = 0
_ = 1 / zero
}
func Stack() {
var pc [16]uintptr
n := runtime.Callers(0, pc[:])
fmt.Println(n, pc)
callers := pc[:n]
frames :
FuncForPC misses the test function because it is inlined. Using FuncForPC
on the results of Callers does not work correctly in the presence of
inlining. That is essentially why CallersFrames was introduced.
The function name is missing because you're using the wrong expression for
it. You shoul