v0.0.574 add syncMap.clear()
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m37s

This commit is contained in:
2025-05-07 15:28:15 +02:00
parent 395e83acf6
commit 959020e3c0
4 changed files with 33 additions and 10 deletions

View File

@@ -119,6 +119,13 @@ func (s *SyncMap[TKey, TData]) Delete(key TKey) bool {
return ok
}
func (s *SyncMap[TKey, TData]) Clear() {
s.lock.Lock()
defer s.lock.Unlock()
s.data = make(map[TKey]TData)
}
func (s *SyncMap[TKey, TData]) Contains(key TKey) bool {
s.lock.Lock()
defer s.lock.Unlock()