Last active
April 8, 2018 11:20
-
-
Save just1689/5a91d7b00f76e7ebb65b95d7fe0fa66e to your computer and use it in GitHub Desktop.
Convert values to futures
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 gen(nums ...int) <-chan int { | |
out := make(chan int) | |
go func() { | |
for _, n := range nums { | |
out <- n | |
} | |
close(out) | |
}() | |
return out | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment