如题,怎么编码呢?
更多评论
package main
import (
"fmt"
"sync"
)
func main() {
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
var j int
for i := 1; i < 10; i++ {
fmt.Println(i)
j = i + 1
}
fmt.Println(j)
}()
wg.Wait()
}
#3