更新golang版本

This commit is contained in:
spiritlhl committed 2024-06-24 05:24:38 +00:00
1 parent b3ce155391
commit 985b09e60e
13 files changed
+11 -27

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
package backtrace
import (
"fmt"
"time"
)
func BackTrace() {
var (
s [12]string // 对应 ips 目标地址数量
c = make(chan Result)
t = time.After(time.Second * 10)
)
for i := range ips {
go trace(c, i)
}
loop:
for range s {
select {
case o := <-c:
s[o.i] = o.s
case <-t:
break loop
}
}
for _, r := range s {
fmt.Println(r)
}
}