From 780d9bbc6907e462c2bced407e54a5a42e2b39ee Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Mon, 9 Nov 2026 15:38:44 -0500 Subject: [PATCH] test: fix lint warnings --- internal/proxy/proxy_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 21e8b28..6a0220a 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/httptest" "net/url" + "strconv" "sync/atomic" "testing" "time" @@ -86,9 +87,14 @@ func TestSecurityGate_Filtering(t *testing.T) { } fromVal, _ := url.QueryUnescape(sanitizedClamped.Get("from")) toVal, _ := url.QueryUnescape(sanitizedClamped.Get("to")) - var f, toInt int64 - fmt.Sscanf(fromVal, "%d", &f) - fmt.Sscanf(toVal, "%d", &toInt) + f, err := strconv.ParseInt(fromVal, 10, 64) + if err != nil { + t.Fatalf("failed parsing fromVal: %v", err) + } + toInt, err := strconv.ParseInt(toVal, 10, 64) + if err != nil { + t.Fatalf("failed parsing toVal: %v", err) + } diffDays := (toInt - f) / (24 * 3600 * 1000) if diffDays > 8 { // allow slight delta for modulus quantization t.Errorf("expected window to be clamped near 7 days, got %d days", diffDays) -- knotmirror 0.0.1