uber-go / goleak

Goroutine leak detector
MIT License
4.54k stars 151 forks source link

Add Cleanup option #78

Closed sywhang closed 2 years ago

sywhang commented 2 years ago

This adds Cleanup option which can be passed to VerifyTestMain and VerifyNone. This takes in a function that will be executed at the end of the leak verification.

Internal Ref: GO-888 Fix #63

codecov[bot] commented 2 years ago

Codecov Report

Merging #78 (cd5fa11) into master (2dfebe8) will increase coverage by 0.80%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   94.11%   94.92%   +0.80%     
==========================================
  Files           5        5              
  Lines         119      138      +19     
==========================================
+ Hits          112      131      +19     
  Misses          4        4              
  Partials        3        3              
Impacted Files Coverage Δ
leaks.go 100.00% <100.00%> (ø)
options.go 100.00% <100.00%> (ø)
testmain.go 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more