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

Method Swap

internal/syncx/map.go:70–73  ·  view source on GitHub ↗
(key K, value V)

Source from the content-addressed store, hash-verified

68}
69
70func (m *Map[K, V]) Swap(key K, value V) (V, bool) {
71 previous, loaded := m.m.Swap(key, value)
72 return previous.(V), loaded
73}

Callers 1

TestMapSwapFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestMapSwapFunction · 0.64