摘要: package main import ( "fmt" "sync" ) func square(test *sync.WaitGroup, n int) { //使用sync.WaitGroup来等待所有goroutine完成 defer test.Done() //确保在 square 函数结束 阅读全文
posted @ 2024-07-13 10:49 春分拂柳 阅读(23) 评论(0) 推荐(0) 编辑

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示