This question already has an answer here:
let's say I want to start a group of goroutines and than wait for all of them to finish (e.g. return). I can think of some channel-based solution (e.g. create a channel and listen to it counting received messages which shall be sent by each of goroutines and quiting after receive corresponding number of msgs) but maybe there's a more elegant/efficient solution because this case seems very common.
</div>