mirror of
https://github.com/gin-gonic/gin.git
synced 2026-04-29 23:23:18 +08:00
chore: lint fixes
This commit is contained in:
parent
cc7b198789
commit
d27dab6e8f
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user