6fb2f565a0bc66ac0be9bb37841976e9
```go
package main
import (
"fmt"
"runtime"
"sync"
)
func init() {
fmt.Println("Current Go Version:", runtime.Version())
}
func main() {
runtime.GOMAXPROCS(1)
count := 10
wg := sync.WaitGroup{}
wg.Add(count * 2)
for i := 0; i < count; i++ {
go func() {
fmt.Printf("[%d]", i)
wg.Done()
}()
}
for i := 0; i < count; i++ {
go func(i int) {
fmt.Printf("-%d-", i)
wg.Done()
}(i)
}
wg.Wait()
}
```
有疑问加站长微信联系(非本文作者)