Why this matters
Parallelism speeds suites and isolation prevents hidden data races.
Mark tests that don't mutate shared state with t.Parallel() and use t.TempDir() for filesystem isolation; avoid package-level globals.
Parallelism speeds suites and isolation prevents hidden data races.
Side-by-side examples engineers can pattern-match during review.
var buf bytes.Buffer
func TestWrite(t testing.T){
write(&buf) // shared global; not isolated
}func TestWrite(t testing.T){
t.Parallel()
dir := t.TempDir()
f := filepath.Join(dir, "out.txt")
if err := writeFile(f); err != nil { t.Fatalf("write: %v", err) }
}t.Parallel(); dir := t.TempDir()var shared bytes.Buffer // used by testsFrom the same buckets as this rule.
Reject PRs adding real PAN/CVV in fixtures, seeds, or mocks. Only use Luhn-valid test PANs from the gateway or opaque tokens (e.g., tok_) and never include CVV. Add a check to fail if a PAN regex is matched. (PCI DSS data minimization)