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

Commit 004deef

Browse files
authored
remove unnecessary use of fmt.Sprintf (#217)
* remove unnecessary use of fmt.Sprintf
1 parent 6d954f5 commit 004deef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func Example_stackTrace() {
195195
func ExampleCause_printf() {
196196
err := errors.Wrap(func() error {
197197
return func() error {
198-
return errors.Errorf("hello %s", fmt.Sprintf("world"))
198+
return errors.New("hello world")
199199
}()
200200
}(), "failed")
201201

stack_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func TestStackTrace(t *testing.T) {
142142
}, {
143143
Cause(func() error {
144144
return func() error {
145-
return Errorf("hello %s", fmt.Sprintf("world"))
145+
return Errorf("hello %s", fmt.Sprintf("world: %s", "ooh"))
146146
}()
147147
}()), []string{
148148
`github.com/pkg/errors.TestStackTrace.func2.1` +

0 commit comments

Comments
 (0)