You can use reflect to select from dynamically changing slice of channels, to lessen the number of goroutines. You can use a fixed number of channels, and multiplex on them (one incoming and one outgoing channel, encapsulate the messages with header for destination), to lessen the number of channels.
But these may not help - maybe you have overseen sth, overcomplicated, or just have an error somewhere. So if your code seems correct and you like it, then first measure: profile it first when idle, then under pressure. Go has nice profiling built-in, see net/http/profiling -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.