From 004deef56200d8bd57ebfd6f8734c08fbd003f6d Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Fri, 3 Jan 2020 13:36:54 +0100 Subject: [PATCH] remove unnecessary use of fmt.Sprintf (#217) * remove unnecessary use of fmt.Sprintf --- example_test.go | 2 +- stack_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example_test.go b/example_test.go index c1fc13e..7d0e286 100644 --- a/example_test.go +++ b/example_test.go @@ -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") diff --git a/stack_test.go b/stack_test.go index 1acd719..aa10a72 100644 --- a/stack_test.go +++ b/stack_test.go @@ -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` +