I wrote the following program:
package main import ( \"fmt\" ) func processevents(list chan func()) { for { //a := <-list //a()
Here is another solution - use range to read from the channel. This code will yield to the scheduler correctly and also terminate properly when the channel is closed.
range
func processevents(list chan func()) { for a := range list{ a() } }