chore: upgrade go 1.25 (#22904)
This commit is contained in:
parent
536e01459a
commit
6f03177a54
8 changed files with 26 additions and 45 deletions
|
|
@ -11,26 +11,21 @@ import (
|
|||
"github.com/jeremywohl/flatten"
|
||||
)
|
||||
|
||||
func workers(log *util.Logger, num int, tasks <-chan string, hits chan<- []tasks.Result) *sync.WaitGroup {
|
||||
func workers(log *util.Logger, num int, ips <-chan string, hits chan<- []tasks.Result) *sync.WaitGroup {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
for range num {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
workunit(log, tasks, hits)
|
||||
wg.Done()
|
||||
}()
|
||||
wg.Go(func() {
|
||||
for ip := range ips {
|
||||
res := taskList.Test(log, "", tasks.ResultDetails{IP: ip})
|
||||
hits <- res
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return &wg
|
||||
}
|
||||
|
||||
func workunit(log *util.Logger, ips <-chan string, hits chan<- []tasks.Result) {
|
||||
for ip := range ips {
|
||||
res := taskList.Test(log, "", tasks.ResultDetails{IP: ip})
|
||||
hits <- res
|
||||
}
|
||||
}
|
||||
|
||||
func Work(log *util.Logger, num int, hosts []string) []tasks.Result {
|
||||
ip := make(chan string)
|
||||
hits := make(chan []tasks.Result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue