ICode9

精准搜索请尝试: 精确搜索
  • GO语言自学_018_for_range防止读写不对应导致的死锁2022-09-09 03:32:20

    代码 package main import "fmt" func main() { numsChan := make(chan int, 10) // 写入 go func() { for i := 1; i <= 50; i++ { numsChan <- i fmt.Println("写入:", i) } fmt.Println("数据全部写完毕,准备关闭管道") close(numsCh

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有