init 1.2.x

This commit is contained in:
YouROK
2020-11-06 15:40:58 +03:00
parent ce87ecabcb
commit a1e17b1cf3
57 changed files with 670 additions and 4003 deletions

View File

@@ -0,0 +1,17 @@
package utils
import (
"sync"
)
func ParallelFor(begin, end int, fn func(i int)) {
var wg sync.WaitGroup
wg.Add(end - begin)
for i := begin; i < end; i++ {
go func(i int) {
fn(i)
wg.Done()
}(i)
}
wg.Wait()
}