GO语言管道例子
package mainimport ( "fmt" "math/rand" "time")func producer(header string, channel chan<- string) { for { channel <- fmt.Sprintf("%s, %v", header, rand.Int31()) time.Sleep(time.Second) }}func xfz(channel <-chan string) {
原创
2020-05-18 16:28:22 ·
447 阅读 ·
0 评论