I have two goroutines independently producing data, each sending it to a channel. In my main goroutine, I\'d like to consume each of these outputs as they come in, but don\'t ca
I wrote a package which provides a function to solve this problem (among several others):
https://github.com/eapache/channels
https://godoc.org/github.com/eapache/channels
Check out the Multiplex function. It uses reflection to scale to an arbitrary number of input channels.
Multiplex