Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Load(key any) (value any, ok bool) Store(key, value any) LoadOrStore(key, value any) (actual any, loaded bool) Delete(key any) (res bool) Range(f func(key, value any) bool) }
Map is a concurrent Map with amortized-constant-time loads, stores, and deletes. It is safe for multiple goroutines to call a Map's methods concurrently.
It is optimized for use in concurrent loops with keys that are stable over time, and either few steady-state stores, or stores localized to one goroutine per key.
For use cases that do not share these attributes, it will likely have comparable or worse performance and worse type safety than an ordinary Map paired with a read-write mutex.
The zero Map is valid and empty.
A Map must not be copied after first use.
Click to show internal directories.
Click to hide internal directories.