Files
moxa/_test/chan9.go
2020-04-15 12:24:04 +02:00

21 lines
234 B
Go

package main
type Channel chan string
type T struct {
Channel
}
func send(c Channel) { c <- "ping" }
func main() {
t := &T{}
t.Channel = make(Channel)
go send(t.Channel)
msg := <-t.Channel
println(msg)
}
// Output:
// ping