mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-06 22:59:33 +08:00
新增 指定IP段数据(-ip) 参数; 新增 延迟测速时显示可用 IP 数量; 新增 有效状态代码(HTTPing 模式所用) 参数; 优化 HTTPing 延迟测速模式; 优化 匹配指定地区 功能
This commit is contained in:
14
utils/csv.go
14
utils/csv.go
@@ -6,10 +6,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -24,7 +21,6 @@ var (
|
||||
InputMinDelay = minDelay
|
||||
Output = defaultOutput
|
||||
PrintNum = 10
|
||||
ColoAble sync.Map
|
||||
)
|
||||
|
||||
// 是否打印测试结果
|
||||
@@ -143,16 +139,6 @@ func (s DownloadSpeedSet) Swap(i, j int) {
|
||||
}
|
||||
|
||||
func (s DownloadSpeedSet) Print() {
|
||||
var colos []string
|
||||
ColoAble.Range(func(key, value interface{}) bool {
|
||||
colos = append(colos, key.(string))
|
||||
return true
|
||||
})
|
||||
if len(colos) != 0 {
|
||||
sort.Strings(colos)
|
||||
colostrings := strings.Join(colos, ",")
|
||||
fmt.Println("\n下次可以考虑机场三字码参数:" + colostrings + "\n")
|
||||
}
|
||||
if NoPrintResult() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ type Bar struct {
|
||||
}
|
||||
|
||||
func NewBar(count int, MyStrStart, MyStrEnd string) *Bar {
|
||||
tmpl := fmt.Sprintf(`{{counters . }}{{ bar . "[" "-" (cycle . "↖" "↗" "↘" "↙" ) "_" "]"}} %s {{string . "MyStr" | green}} %s `, MyStrStart, MyStrEnd)
|
||||
tmpl := fmt.Sprintf(`{{counters . }} {{ bar . "[" "-" (cycle . "↖" "↗" "↘" "↙" ) "_" "]"}} %s {{string . "MyStr" | green}} %s `, MyStrStart, MyStrEnd)
|
||||
bar := pb.ProgressBarTemplate(tmpl).Start(count)
|
||||
return &Bar{pb: bar}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user