go 标签 baipeng 2018-08-12 技术 tech, 技术 0 评论 字数统计: 50(字) 阅读时长: 1(分)12345678910111213141516171819func mian() { c := make(chan string,1) defer close(c) go func() { for i := 0; i < 10; i++ { c <- fmt.Sprint("baipeng", i) } }() hello: for { select { case s := <-c: fmt.Println(s) default: break hello } }}