// 清空Error channel func dumpErrors(p *sarama.Producer, timer chan bool) { for { select { case <-p.Errors(): case <-timer: runtime.Gosched() } } }