18 lines
203 B
Go
18 lines
203 B
Go
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
import "sync"
|
||
|
|
||
|
var wg sync.WaitGroup
|
||
|
|
||
|
func main() {
|
||
|
for i := 0; i < 5; i++ {
|
||
|
go func() {
|
||
|
defer wg.Done()
|
||
|
wg.Add(1)
|
||
|
fmt.Println("Hello World")
|
||
|
}()
|
||
|
}
|
||
|
wg.Wait()
|
||
|
}
|