From d27dab6e8f87ddccb4c49d2d111b1f1a46d1fc4f Mon Sep 17 00:00:00 2001 From: Shirshendu Bhowmick <12836504+shirshendubhowmick@users.noreply.github.com> Date: Sat, 28 Mar 2026 01:08:09 +0530 Subject: [PATCH] chore: lint fixes --- context_test.go | 2 +- gin_test.go | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/context_test.go b/context_test.go index 9243a852..7f364286 100644 --- a/context_test.go +++ b/context_test.go @@ -3131,7 +3131,7 @@ func TestRemoteIPFail(t *testing.T) { c.Request.RemoteAddr = "[:::]:80" ip, err := netip.ParseAddr(c.RemoteIP()) trust := c.engine.isTrustedProxy(ip) - assert.NotNil(t, err) + require.Error(t, err) assert.False(t, trust) } diff --git a/gin_test.go b/gin_test.go index a5c899bd..fe6bbdfd 100644 --- a/gin_test.go +++ b/gin_test.go @@ -970,14 +970,6 @@ func TestPrepareTrustedCIRDsWith(t *testing.T) { } } -func parseCIDR(cidr string) netip.Prefix { - prefix, err := netip.ParsePrefix(cidr) - if err != nil { - fmt.Println(err) - } - return prefix.Masked() -} - func assertRoutePresent(t *testing.T, gotRoutes RoutesInfo, wantRoute RouteInfo) { for _, gotRoute := range gotRoutes { if gotRoute.Path == wantRoute.Path && gotRoute.Method == wantRoute.Method {