Files
LearnGO/go/pkg/mod/github.com/go-delve/delve@v1.23.0/_fixtures/issue387.go
T
2024-09-19 21:38:24 -04:00

22 lines
273 B
Go

package main
import (
"fmt"
"sync"
)
func dostuff(id int, wg *sync.WaitGroup) {
fmt.Println("goroutine:", id)
fmt.Println("goroutine:", id)
wg.Done()
}
func main() {
var wg sync.WaitGroup
wg.Add(10)
for i := 0; i < 10; i++ {
go dostuff(i, &wg)
}
wg.Wait()
}