You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The premise is that we want tests to use defer so that they read like idiomatic Go code and that there is no mixed usage of defer and t.Cleanup (since the order of execution is hard to reason about, and rarely the intent). The exception is test helper functions.
This was requested in #3113 but not required for merging the PR.
A few examples for ruleguard rules was floated in #3113 but both have unnecessary repercussions:
Simple rule is too aggressive
More specific rule does not catch non-toplevel uses (e.g. if the t.Cleanup is inside if {} it won't be caught