c.AllocaCStrs; ssa: AllocaU/ArrayAlloca/Times/AllocaCStrs

This commit is contained in:
xushiwei
2024-07-12 21:40:13 +08:00
parent 2d29d1549a
commit e138951e9e
11 changed files with 152 additions and 71 deletions

21
_demo/_chandemo/chan.go Normal file
View File

@@ -0,0 +1,21 @@
package main
func main() {
c1 := make(chan string)
c2 := make(chan string, 1)
go func() {
c1 <- "ch1"
}()
go func() {
c2 <- "ch2"
}()
for i := 0; i < 2; i++ {
select {
case msg1 := <-c1:
println(msg1)
case msg2 := <-c2:
println(msg2)
}
}
}