Hi, I have a program like this.
I have a un-buffered data channel that accept slice of string.
I put an initial slice with one string into the channel.
Then I listen on the channel with <- operator, and with the data, i create go routines for each of the elements.
These go routines put slices back into the channel, and wait if the channal if filled.
And it continues. Some go routines will terminate without putting data back in. And there will be a point where all routine will stop and I ended up waiting on the channel.
My problem is, i want to close the channel, when there is no go routine running of a particular group. You can assume there are other groups, since this is a part of a larger program. How should I deal with it?