This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package main
import "fmt"
func main() {
//第一次1,select选择一个能执行的即 ch<-i,把1放入通道,第二次,不能放入,取出,第三次再放入,第四次再取出
ch := make(chan int, 1)
for i := 1; i <= 10; i++ {
select {
case x := <-ch:
fmt.Println(x)
case ch <- i:
}