sourcegraph / appdash

Application tracing system for Go, based on Google's Dapper.
https://sourcegraph.com
Other
1.72k stars 137 forks source link

Use t.Cleanup instead of defer in Golang code tests #213

Open sourcegraph-bot opened 4 years ago

sourcegraph-bot commented 4 years ago

Using a proper defined cleanup function like

t.Cleanup(func () {
  // do sth
})

is more explicit than just

defer func () {
  // do sth
}

so let's use that approach.