@@ -155,12 +155,12 @@ func TestTrimGOPATH(t *testing.T) {
155155 "github.com/pkg/errors/stack_test.go" ,
156156 }}
157157
158- for _ , tt := range tests {
158+ for i , tt := range tests {
159159 pc := tt .Frame .pc ()
160160 fn := runtime .FuncForPC (pc )
161161 file , _ := fn .FileLine (pc )
162162 got := trimGOPATH (fn .Name (), file )
163- testFormatRegexp (t , got , "%s" , tt .want )
163+ testFormatRegexp (t , i , got , "%s" , tt .want )
164164 }
165165}
166166
@@ -185,7 +185,7 @@ func TestStackTrace(t *testing.T) {
185185 },
186186 }, {
187187 func () error { return New ("ooh" ) }(), []string {
188- `github.com/pkg/errors.(func·005 |TestStackTrace.func1)` +
188+ `github.com/pkg/errors.(func·009 |TestStackTrace.func1)` +
189189 "\n \t .+/github.com/pkg/errors/stack_test.go:187" , // this is the stack of New
190190 "github.com/pkg/errors.TestStackTrace\n " +
191191 "\t .+/github.com/pkg/errors/stack_test.go:187" , // this is the stack of New's caller
@@ -196,9 +196,9 @@ func TestStackTrace(t *testing.T) {
196196 return Errorf ("hello %s" , fmt .Sprintf ("world" ))
197197 }()
198198 }()), []string {
199- `github.com/pkg/errors.(func·006 |TestStackTrace.func2.1)` +
199+ `github.com/pkg/errors.(func·010 |TestStackTrace.func2.1)` +
200200 "\n \t .+/github.com/pkg/errors/stack_test.go:196" , // this is the stack of Errorf
201- `github.com/pkg/errors.(func·007 |TestStackTrace.func2)` +
201+ `github.com/pkg/errors.(func·011 |TestStackTrace.func2)` +
202202 "\n \t .+/github.com/pkg/errors/stack_test.go:197" , // this is the stack of Errorf's caller
203203 "github.com/pkg/errors.TestStackTrace\n " +
204204 "\t .+/github.com/pkg/errors/stack_test.go:198" , // this is the stack of Errorf's caller's caller
0 commit comments