This question already has an answer here:
I am running a cpu intensive script on 8 different goroutines. Each of these goroutines will take at least a few minutes to complete, and I was wondering if something like this is possible:
for i := 0; i < len(input); i += 1 {
wait_for_number_of_processes_running_to_be_less_than_8
go calc_math_and_things(input[i])
}
</div>