Canonical guidance

Use when

Avoid

Preferred pattern

counts := make(map[string]int, expected)

for _, item := range items {
	counts[item.Key]++
}

Anti-pattern

Explanation: This anti-pattern is tempting because runtime details sound precise, but map-heavy performance work still needs real profiles and benchmarks.

Why

Related pages

Sources