2022-04-25 12:23:57 -05:00

13 lines
218 B
Go

package runner
// cleanup stacks cleanup functions to call when Close is called.
func (r *Runner) cleanup(f func()) {
oldF := r.cleanupFunc
r.cleanupFunc = func() {
defer f()
if oldF != nil {
oldF()
}
}
}