通道
https://gobyexample-cn.github.io/channels
go
package main
import "fmt"
func main() {
messages := make(chan string)
go func() { messages <- "ping" }()
msg := <-messages
fmt.Println(msg)
}默认发送和接收操作是阻塞的