Skip to content

telebroad/gsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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())
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages