github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/backup/select9.gno (about) 1 package main 2 3 type T struct { 4 c1 chan string 5 } 6 7 func main() { 8 t := &T{} 9 t.c1 = make(chan string) 10 11 go func() { 12 select { 13 case t.c1 <- "done": 14 } 15 }() 16 17 msg1 := <-t.c1 18 println("received from c1:", msg1) 19 } 20 21 // Output: 22 // received from c1: done