package main
import (
"fmt"
"sync"
"github.com/go-faker/faker/v4"
)
func main() {
var wg sync.WaitGroup
wg.Add(1000)
fmt.Println("Running for loop…")
for i := 0; i < 1000; i++ {
go func(i int) {
defer wg.Done()
fmt.Println( fmt.Sprintf("%s-%s",faker.FirstName(),faker.LastName()) )
}(i)
}
wg.Wait()
fmt.Println("Finished for loop")
}
Error