diff --git a/pkg_test.go b/pkg_test.go index f233cf7..87ff8d8 100644 --- a/pkg_test.go +++ b/pkg_test.go @@ -70,7 +70,12 @@ func Example_multipleFields() { // Trace can be used to simplify logging of start and completion events, // for example an upload which may fail. -func Example_trace() (err error) { - defer log.Trace("upload").Stop(&err) - return nil +func Example_trace() { + fn := func() (err error) { + defer log.Trace("upload").Stop(&err) + return + } + + fn() + return }