Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 373 Bytes

README.md

File metadata and controls

24 lines (21 loc) · 373 Bytes

GSYNC

gsync is a generic version of the sync.Map in golang

Usage

package main

func main()  {
	SyncedMap := Map[string, int]{}
	wg := sync.WaitGroup{}
	for i := range 100 {
		wg.Add(1)
		go func(i int) {
			SyncedMap.Store(fmt.Sprint(i), i)
			wg.Done()
		}(i)
	}
	wg.Wait()
	t.Logf(SyncedMap.String())
	SyncedMap.Clear()
	t.Logf(SyncedMap.String())
}