标签:import sync func amp port pac add fun for
package main
import (
"fmt"
"sync"
)
func say(i int ,wg *sync.WaitGroup) {
defer wg.Done()
fmt.Println(i)
}
func main() {
var wg sync.WaitGroup
for i:=0;i<1000;i++{
wg.Add(1)
go say(i,&wg)
}
fmt.Println(4444444)
wg.Wait()
}
标签:import sync func amp port pac add fun for
原文地址:https://www.cnblogs.com/php-linux/p/13098994.html