Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 308074f

Browse files
committed
Merge branch 'bep-patch-1'
2 parents 4f47277 + 937e8c5 commit 308074f

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
//
8383
// if err, ok := err.(stackTracer); ok {
8484
// for _, f := range err.StackTrace() {
85-
// fmt.Printf("%+s:%d", f)
85+
// fmt.Printf("%+s:%d\n", f, f)
8686
// }
8787
// }
8888
//

stack.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import (
1111
// Frame represents a program counter inside a stack frame.
1212
type Frame runtime.Frame
1313

14-
// pc returns the program counter for this frame;
15-
// multiple frames may have the same PC value.
16-
func (f Frame) pc() uintptr { return runtime.Frame(f).PC }
17-
1814
// file returns the full path to the file that contains the
1915
// function for this Frame's pc.
2016
func (f Frame) file() string {
@@ -61,7 +57,7 @@ func (f Frame) Format(s fmt.State, verb rune) {
6157
case 'd':
6258
fmt.Fprintf(s, "%d", f.line())
6359
case 'n':
64-
name := runtime.FuncForPC(f.pc()).Name()
60+
name := runtime.Frame(f).Function
6561
io.WriteString(s, funcname(name))
6662
case 'v':
6763
f.Format(s, 's')

stack_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ var initpc = caller()
1010

1111
type X struct{}
1212

13-
//go:noinline
13+
// val returns a Frame pointing to itself.
1414
func (x X) val() Frame {
1515
return caller()
1616
}
1717

18-
//go:noinline
18+
// ptr returns a Frame pointing to itself.
1919
func (x *X) ptr() Frame {
2020
return caller()
2121
}

0 commit comments

Comments
 (0)