ГП
func main() {
var x []string
test()
var activeHosts *[]string
var wg sync.WaitGroup
s := time.Now()
hosts := Cidr2Slice(Network)
wg.Add(len(hosts))
work := func (host string, wg *sync.WaitGroup) {
defer wg.Done()
res := getModel(host)
if res != nil {
x = []string{res[0], res[1]}
//fmt.Println(activeHosts)
}
}
for _, Host := range hosts {
go work(Host, &wg)
activeHosts = &x
fmt.Println(*activeHosts)
}
wg.Wait()
fmt.Println(time.Now().Sub(s))
}