v0.0.543
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m7s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m7s
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user