func (f Frame) Format(p Printer) {
	if p.Detail() {
		function, file, line := f.location()
		if function != "" {
			p.Printf("%s\n    ", function)
		}
		if file != "" {
			p.Printf("%s:%d\n", file, line)
		}
	}
}
Format prints the stack as error detail.
It should be called from an error's Format implementation
after printing any other error detail.
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
}
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
}