-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
https://walkingsun.github.io/WindBlog/2020/02/08/go-routine/
创建协程 jobCount := 10 // sync.WaitGroup 监控所有协程的状态,从而保证主协程结束时所有的子协程已经退出 group := sync.WaitGroup{} for i:=0;i < jobCount;i++ { group.Add(1) go func(i int) { fmt.Println(