improve: use IndexByte to find the colon of ip address (#92)
This commit is contained in:
+1
-1
@@ -575,7 +575,7 @@ func handleTcpPingTask(task *pb.Task, result *pb.TaskResult) {
|
||||
result.Data = err.Error()
|
||||
return
|
||||
}
|
||||
if strings.Contains(ipAddr, ":") {
|
||||
if strings.IndexByte(ipAddr, ':') != -1 {
|
||||
ipAddr = fmt.Sprintf("[%s]", ipAddr)
|
||||
}
|
||||
printf("TCP-Ping Task: Pinging %s:%s", ipAddr, port)
|
||||
|
||||
Reference in New Issue
Block a user