func main() { wg.Add(2) go test1() go test2() wg.Wait() } func test1() { defer wg.Done() for i:=0;i<10;i++{ fmt.Println(i) } } func test2() { defer wg.Done() for i:=0;i<10;i++{ fmt.Println(i) } }
go 协程阻塞
原文:https://www.cnblogs.com/php-linux/p/13150644.html