Atlas › Test

TestMap_Delete

Exact test identity: go.temporal.io/server/common/collection/TestMap_Delete

Package
go.temporal.io/server/common/collection
Suite / test hierarchy
TestMap_Delete
Test
TestMap_Delete
Introduced at
TestMap_Delete Frontier kind: Test frontier
Covered ranges
4
Covered lines
22
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/collection/sync_map.go 22 covered LOC · 4 ranges

Open complete file

15 }
16
17 > func NewSyncMap[K comparable, V any]() SyncMap[K, V] { sync_map.go
18 > return SyncMap[K, V]{
19 > RWMutex: &sync.RWMutex{},
20 > contents: make(map[K]V),
21 > }
22 > }
23
24 > func (m *SyncMap[K, V]) Get(key K) (value V, ok bool) { sync_map.go
25 > m.RLock()
26 > defer m.RUnlock()
27 > value, ok = m.contents[key]
28 > return
29 > }
30
31 func (m *SyncMap[K, V]) GetOrSet(key K, value V) (v V, exist bool) {
47 }
48
49 > func (m *SyncMap[K, V]) Set(key K, value V) { sync_map.go
50 > m.Lock()
51 > defer m.Unlock()
52 > m.contents[key] = value
53 > }
54
55 > func (m *SyncMap[K, V]) Delete(key K) { sync_map.go
56 > m.Lock()
57 > defer m.Unlock()
58 > delete(m.contents, key)
59 > }
60
61 func (m *SyncMap[K, V]) Pop(key K) (value V, ok bool) {