improve: use IndexByte to find the colon of ip address (#92)
This commit is contained in:
1 parent
ee37e35eb2
commit
88efe2d1d5
3 files changed
+5
-5
No files matched your search
+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