https://play.golang.org/p/9uWepL4nu2n
Im putting items into my channel
, and pulling from diff goroutines.
After i pull everything needed from the channel
, i get a deadlock error.
using a normal for loop
like
for i := 0; i < *n; i++ {
res := <-c
fmt.Printf("[%s %v]\n", res.label, res.time.Format("15: 04: 05.0000"))
}
works, but i need to work with it using range
any idea whats wrong with the code?
i think the issue is finding where i can close my channel
https://play.golang.org/p/9uWepL4nu2n