Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K any, V any] struct { // sync.Map is exported for flexibility, so you can still // use it if required sync.Map }
Map mimics sync.Map but with generics
func (*Map[K, V]) Load ¶
Load mimics sync.Map{}'s Load
Example ¶
myMap := Map[string, string]{} myMap.Store("a", "b") result, ok := myMap.Load("a") fmt.Println(result, ok)
func (*Map[K, V]) LoadAndDelete ¶
LoadAndDelete mimics sync.Map{}'s LoadAndDelete
func (*Map[K, V]) LoadOrStore ¶
LoadOrStore mimics sync.Map{}'s LoadOrStore
Click to show internal directories.
Click to hide internal directories.