示例#1
0
func ExampleCaller_skip1() {
	skip1Caller := errors.Caller(1)

	fmt.Println(skip1Caller[0].FuncName)
	fmt.Println(skip1Caller[1].FuncName)

	// Output:
	// github.com/chai2010/errors_test.ExampleCaller_skip1
	// testing.runExample
}
示例#2
0
func ExampleCaller_skip0() {
	skip0Caller := errors.Caller(0)

	fmt.Println(skip0Caller[0].FuncName)
	fmt.Println(skip0Caller[1].FuncName)

	// Output:
	// github.com/chai2010/errors.Caller
	// github.com/chai2010/errors_test.ExampleCaller_skip0
}