Created
January 29, 2018 07:07
-
-
Save campoy/84d3f25823575ef4ba8bf94f6c90ac5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func merge(cs ...<-chan int) <-chan int { | |
out := make(chan int) | |
for _, c := range cs { | |
go func() { | |
for v := range c { | |
out <- v | |
} | |
}() | |
} | |
return out | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment