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 {