Skip to content

Commit

Permalink
fix Example_trace(), should not return anything
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 18, 2020
1 parent 3edb93e commit 2e51804
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2e51804

Please sign in to comment.