package
Version:
v1.23.13
Opens a new window with list of versions in this module.
Published: Mar 26, 2026
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Map
-
func (s *Map[K, V]) Delete(key K)
-
func (s *Map[K, V]) Load(key K) (V, bool)
-
func (s *Map[K, V]) LoadAndDelete(key K) (V, bool)
-
func (s *Map[K, V]) LoadOrStore(key K, value V) (V, bool)
-
func (s *Map[K, V]) Range(f func(key K, value V) bool)
-
func (s *Map[K, V]) Store(key K, value V)
Map is a type-safe wrapper around sync.Map that eliminates
type assertions at call sites.
A Map must not be copied after first use.
func (s *Map[K, V]) Delete(key K)
Delete removes the value for key.
func (s *Map[K, V]) Load(key K) (V, bool)
Load returns the stored value for key.
func (s *Map[K, V]) LoadAndDelete(key K) (V, bool)
LoadAndDelete deletes the value for key and returns it if
present.
func (s *Map[K, V]) LoadOrStore(key K, value V) (V, bool)
LoadOrStore returns the existing value for the key if present.
func (s *Map[K, V]) Range(f func(key K, value V) bool)
Range calls f sequentially for each key and value present in
the map.
func (s *Map[K, V]) Store(key K, value V)
Store saves value under key.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.