mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
增加scanf时的默认值
This commit is contained in:
@@ -107,7 +107,7 @@ func FastTestv6(tm bool, outEnable bool) {
|
||||
fmt.Print("请选择选项:")
|
||||
_, err := fmt.Scanln(&c)
|
||||
if err != nil {
|
||||
return
|
||||
c = "1"
|
||||
}
|
||||
|
||||
ft := FastTracer{}
|
||||
|
||||
@@ -121,7 +121,7 @@ func FastTest(tm bool, outEnable bool) {
|
||||
fmt.Print("请选择选项:")
|
||||
_, err := fmt.Scanln(&c)
|
||||
if err != nil {
|
||||
return
|
||||
c = "1"
|
||||
}
|
||||
if c == "2" {
|
||||
FastTestv6(tm, outEnable)
|
||||
@@ -132,7 +132,7 @@ func FastTest(tm bool, outEnable bool) {
|
||||
fmt.Print("请选择选项:")
|
||||
_, err = fmt.Scanln(&c)
|
||||
if err != nil {
|
||||
return
|
||||
c = "1"
|
||||
}
|
||||
|
||||
ft := FastTracer{}
|
||||
|
||||
@@ -110,7 +110,7 @@ func DomainLookUp(host string, ipv4Only bool, dotServer string) net.IP {
|
||||
fmt.Printf("Your Option: ")
|
||||
_, err := fmt.Scanln(&index)
|
||||
if err != nil {
|
||||
return nil
|
||||
index = 0
|
||||
}
|
||||
if index >= len(ips) || index < 0 {
|
||||
fmt.Println("Your Option is invalid")
|
||||
|
||||
Reference in New Issue
Block a user