errors
errors copied to clipboard
return *stack instead of stack
Hi, I see that the callers in the source code return *stack instead of stack. Why does this happen?
func callers() *stack {
const depth = 32
var pcs [depth]uintptr
n := runtime.Callers(3, pcs[:])
var st stack = pcs[0:n]
return &st
}
Honestly don’t remember. I can’t think of a reason why it was don’t that way.
I think because fundamental uses *stack. So it is easier to write stack: callers(). So the question is, why fundamental uses *stack. :-)