Canonical guidance

Use when

Avoid

Preferred pattern

seen := map[string]struct{}{}

if _, ok := seen[id]; !ok {
	seen[id] = struct{}{}
}

Anti-pattern

Explanation: This anti-pattern is tempting because test runs can look stable, but order dependencies tend to fail when the data or runtime changes.

Why

Related pages

Sources