diff --git a/internal/server/handlers.go b/internal/server/handlers.go index a32e784..d045b7e 100644 --- a/internal/server/handlers.go +++ b/internal/server/handlers.go @@ -1695,7 +1695,7 @@ func (s *Server) handleCollectStart(w http.ResponseWriter, r *http.Request) { // pingHost dials host:port up to total times with 2s timeout each, returns true if // at least need attempts succeeded. func pingHost(host string, port int, total, need int) (bool, string) { - addr := fmt.Sprintf("%s:%d", host, port) + addr := net.JoinHostPort(host, strconv.Itoa(port)) var successes atomic.Int32 done := make(chan struct{}, total) for i := 0; i < total; i++ {