package initutils import ( "sync" ) var globalWaitGroup sync.WaitGroup func GlobalWaitGroupWait() { globalWaitGroup.Wait() } func GlobalWaitGroupWaitGo(f func()) { globalWaitGroup.Add(1) go func() { defer globalWaitGroup.Done() f() }() }