main is the entry point for the program.
()
| 16 | |
| 17 | // main is the entry point for the program. |
| 18 | func main() { |
| 19 | c := make(chan int) |
| 20 | go printer(c) |
| 21 | wg.Add(1) |
| 22 | |
| 23 | // Send 10 integers on the channel. |
| 24 | for i := 1; i <= 10; i++ { |
| 25 | c <- i |
| 26 | } |
| 27 | |
| 28 | close(c) |
| 29 | wg.Wait() |
| 30 | } |