go-examples/sandbox/main.go

18 lines
203 B
Go
Raw Normal View History

2017-07-08 12:54:39 +00:00
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()
}