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 interface{}) (value interface{}, ok bool) Store(key, value interface{}) LoadOrStore(key, value interface{}) (actual interface{}, loaded bool) Delete(key interface{}) (res bool) Range(f func(key, value interface{}) 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.