package database
import (
"sync"
"time"
)
func ListCaiji(ipList []string) []string{
var valueList []string
var wg sync.WaitGroup
for _,ip := range ipList {
wg.Add(1)
go func(ip string){
o := OneObj(ip)
v := OneLoadTxt(o)
valueList=append(valueList,v)
time.Sleep(10 * time.Second)
wg.Done()
}(ip)
}
wg.Wait()
return valueList
}
Go基础系列:WaitGroup用法
最新推荐文章于 2024-06-01 15:55:13 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)