github.com/traefik/yaegi@v0.15.1/_test/select9.go (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