Canonical guidance

Use when

Avoid

Preferred pattern

var cache sync.Map
cache.Store(key, value)
v, ok := cache.Load(key)

Anti-pattern

Explanation: This anti-pattern is tempting because the API looks purpose-built, but it often makes simple state harder to understand and type-check.

Why

Related pages

Sources