package main import ( "fmt" "time" ) func print(ci <-chan int) { //TODO: implement for value := range ci { time.Sleep(100 * time.Millisecond) fmt.Println(value) } } func main() { c := make(chan int) done := make(chan bool) go func() { print(c); done <- true; close(done) }() c <- 1 c <- 2 c <- 3 close(c) <-done }