From 37fc41945e48145e3e991e2eb691a1270ef3d198 Mon Sep 17 00:00:00 2001 From: Eno Compton Date: Wed, 13 Nov 2024 14:41:37 -0800 Subject: [PATCH] chore: don't overwrite builtin max function (#719) --- internal/healthcheck/healthcheck.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/healthcheck/healthcheck.go b/internal/healthcheck/healthcheck.go index 2c0f6977..9e9f1abd 100644 --- a/internal/healthcheck/healthcheck.go +++ b/internal/healthcheck/healthcheck.go @@ -101,8 +101,8 @@ func (c *Check) HandleReadiness(w http.ResponseWriter, _ *http.Request) { // Proxy has not stopped. } - if open, max := c.proxy.ConnCount(); max > 0 && open == max { - err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, max) + if open, maxCount := c.proxy.ConnCount(); maxCount > 0 && open == maxCount { + err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, maxCount) c.logger.Errorf("[Health Check] Readiness failed: %v", err) w.WriteHeader(http.StatusServiceUnavailable) w.Write([]byte(err.Error()))