func (f Frame) location() (function, file string, line int) {
	frames := runtime.CallersFrames(f.frames[:])
	if _, ok := frames.Next(); !ok {
		return "", "", 0
	}
	fr, ok := frames.Next()
	if !ok {
		return "", "", 0
	}
	return fr.Function, fr.File, fr.Line
}
location reports the file, line, and function of a frame.

The returned function may be "" even if file and line are not.
package xerrors
import (
	"runtime"
)
type Frame struct {
	frames [3]uintptr
}
func Caller(skip int) Frame {
	var s Frame
	runtime.Callers(skip+1, s.frames[:])
	return s
}