This repository was archived by the owner on Dec 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ func (w wrapper) Format(s fmt.State, verb rune) {
145145 case 'v' :
146146 if s .Flag ('+' ) {
147147 fmt .Fprintf (s , "%+v\n " , w .Cause ())
148- fmt .Fprintf (s , "%+v: %s" , w .StackTrace ()[0 ], w .msg )
148+ io .WriteString (s , w .msg )
149+ fmt .Fprintf (s , "%+v" , w .StackTrace ())
149150 return
150151 }
151152 fallthrough
Original file line number Diff line number Diff line change @@ -107,8 +107,9 @@ func TestFormatWrapf(t *testing.T) {
107107 Wrap (io .EOF , "error" ),
108108 "%+v" ,
109109 "EOF\n " +
110+ "error\n " +
110111 "github.com/pkg/errors.TestFormatWrapf\n " +
111- "\t .+/github.com/pkg/errors/format_test.go:107: error " ,
112+ "\t .+/github.com/pkg/errors/format_test.go:107" ,
112113 }, {
113114 Wrapf (New ("error" ), "error%d" , 2 ),
114115 "%v" ,
@@ -118,7 +119,14 @@ func TestFormatWrapf(t *testing.T) {
118119 "%+v" ,
119120 "error\n " +
120121 "github.com/pkg/errors.TestFormatWrapf\n " +
121- "\t .+/github.com/pkg/errors/format_test.go:117" ,
122+ "\t .+/github.com/pkg/errors/format_test.go:118" ,
123+ }, {
124+ Wrap (Wrap (io .EOF , "error1" ), "error2" ),
125+ "%+v" ,
126+ "EOF\n " +
127+ "error1\n " +
128+ "github.com/pkg/errors.TestFormatWrapf\n " +
129+ "\t .+/github.com/pkg/errors/format_test.go:124\n " ,
122130 }}
123131
124132 for _ , tt := range tests {
You can’t perform that action at this time.
0 commit comments