chore: fix lint errors (#2520)

This commit is contained in:
Kevin Wan
2022-10-17 06:30:58 +08:00
committed by GitHub
parent d4c9fd2aff
commit 05a5de7c6d
27 changed files with 117 additions and 148 deletions

View File

@@ -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))
}