摘要: //信道 协程通信的管道package main import ( "fmt") func one(a chan int, b int) { a <- b}func main() { a := make(chan int) go one(a, 5) b := <-a fmt.Println(b)} 阅读全文
posted @ 2020-05-19 17:25 澜海上的星 阅读(180) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "time") func one() { fmt.Println("one")}func two() { fmt.Println("two")}func main() { go one() go two() time.Sleep(1 * tim 阅读全文
posted @ 2020-05-19 16:32 澜海上的星 阅读(84) 评论(0) 推荐(0)