Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func receiver(ch <-chan int) {
- for {
- i := <-ch
- fmt.Println(i)
- }
- }
- func main() {
- ch := make(chan int)
- go receiver(ch)
- i := 0
- for i < 10000 {
- ch <- i
- i++
- }
- fmt.Println("Hello, playground")
- }
Add Comment
Please, Sign In to add comment