chore: fix lint errors (#2520)
This commit is contained in:
@@ -255,7 +255,7 @@ func TestWithPrefix(t *testing.T) {
|
||||
},
|
||||
}
|
||||
WithPrefix("/api")(&fr)
|
||||
var vals []string
|
||||
vals := make([]string, 0, len(fr.routes))
|
||||
for _, r := range fr.routes {
|
||||
vals = append(vals, r.Path)
|
||||
}
|
||||
@@ -510,7 +510,7 @@ func TestServer_WithChain(t *testing.T) {
|
||||
)
|
||||
rt := router.NewRouter()
|
||||
assert.Nil(t, server.ngin.bindRoutes(rt))
|
||||
req, err := http.NewRequest(http.MethodGet, "/", nil)
|
||||
req, err := http.NewRequest(http.MethodGet, "/", http.NoBody)
|
||||
assert.Nil(t, err)
|
||||
rt.ServeHTTP(httptest.NewRecorder(), req)
|
||||
assert.Equal(t, int32(5), atomic.LoadInt32(&called))
|
||||
@@ -531,7 +531,7 @@ func TestServer_WithCors(t *testing.T) {
|
||||
Router: r,
|
||||
middleware: cors.Middleware(nil, "*"),
|
||||
}
|
||||
req := httptest.NewRequest(http.MethodOptions, "/", nil)
|
||||
req := httptest.NewRequest(http.MethodOptions, "/", http.NoBody)
|
||||
cr.ServeHTTP(httptest.NewRecorder(), req)
|
||||
assert.Equal(t, int32(0), atomic.LoadInt32(&called))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user