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

Commit

Permalink
remove unnecessary use of fmt.Sprintf (#217)
Browse files Browse the repository at this point in the history
* remove unnecessary use of fmt.Sprintf
  • Loading branch information
aperezg committed Jan 3, 2020
1 parent 6d954f5 commit 004deef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example_test.go
Expand Up @@ -195,7 +195,7 @@ func Example_stackTrace() {
func ExampleCause_printf() {
err := errors.Wrap(func() error {
return func() error {
return errors.Errorf("hello %s", fmt.Sprintf("world"))
return errors.New("hello world")
}()
}(), "failed")

Expand Down
2 changes: 1 addition & 1 deletion stack_test.go
Expand Up @@ -142,7 +142,7 @@ func TestStackTrace(t *testing.T) {
}, {
Cause(func() error {
return func() error {
return Errorf("hello %s", fmt.Sprintf("world"))
return Errorf("hello %s", fmt.Sprintf("world: %s", "ooh"))
}()
}()), []string{
`github.com/pkg/errors.TestStackTrace.func2.1` +
Expand Down

0 comments on commit 004deef

Please sign in to comment.