MCPcopy
hub / github.com/nats-io/nats.go / Load

Method Load

internal/syncx/map.go:25–32  ·  view source on GitHub ↗
(key K)

Source from the content-addressed store, hash-verified

23}
24
25func (m *Map[K, V]) Load(key K) (V, bool) {
26 v, ok := m.m.Load(key)
27 if !ok {
28 var empty V
29 return empty, false
30 }
31 return v.(V), true
32}
33
34func (m *Map[K, V]) Store(key K, value V) {
35 m.m.Store(key, value)

Callers 15

FetchMethod · 0.80
FetchBatchMethod · 0.80
TestMapLoadFunction · 0.80
TestMapStoreFunction · 0.80
TestMapDeleteFunction · 0.80
TestMapLoadAndDeleteFunction · 0.80
TestMapCompareAndSwapFunction · 0.80
TestMapCompareAndDeleteFunction · 0.80
TestMapSwapFunction · 0.80
ConsumeMethod · 0.80

Calls

no outgoing calls

Tested by 11

TestMapLoadFunction · 0.64
TestMapStoreFunction · 0.64
TestMapDeleteFunction · 0.64
TestMapLoadAndDeleteFunction · 0.64
TestMapCompareAndSwapFunction · 0.64
TestMapCompareAndDeleteFunction · 0.64
TestMapSwapFunction · 0.64
TestConsumerOverflowFunction · 0.64
TestConsumerPinnedFunction · 0.64