Reading List

Why to prefer `t.Cleanup` to `defer` in tests with subtests using `t.Parallel` from Fragments — brandur.org RSS feed.

Why to prefer `t.Cleanup` to `defer` in tests with subtests using `t.Parallel`

Go’s defer and t.Cleanup have similar semantics, but there’s a good reason to prefer the use of t.Cleanup specifically in the presence of parallel subtests.