v0.0.543
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m7s

This commit is contained in:
2024-11-13 15:03:51 +01:00
parent 8a92a6cc52
commit d9517fe73c
8 changed files with 723 additions and 14 deletions

View File

@@ -7,6 +7,10 @@ type SyncMap[TKey comparable, TData any] struct {
lock sync.Mutex
}
func NewSyncMap[TKey comparable, TData any]() *SyncMap[TKey, TData] {
return &SyncMap[TKey, TData]{data: make(map[TKey]TData), lock: sync.Mutex{}}
}
func (s *SyncMap[TKey, TData]) Set(key TKey, data TData) {
s.lock.Lock()
defer s.lock.Unlock()