Skip to content

Commit 1ea8944

Browse files
committed
🎨 Style(Ctx): Respect linter in tests
1 parent a901e8f commit 1ea8944

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ctx_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5936,17 +5936,17 @@ func Test_Ctx_End(t *testing.T) {
59365936
app := New()
59375937

59385938
app.Get("/", func(c Ctx) error {
5939-
c.SendString("Hello, World!")
5939+
c.SendString("Hello, World!") //nolint:errcheck // unnecessary to check error
59405940
return c.End()
59415941
})
59425942

59435943
resp, err := app.Test(httptest.NewRequest(MethodGet, "/", nil))
59445944
require.NoError(t, err)
59455945
require.NotNil(t, resp)
5946-
require.Equal(t, resp.StatusCode, 200)
5946+
require.Equal(t, 200, resp.StatusCode)
59475947
body, err := io.ReadAll(resp.Body)
59485948
require.NoError(t, err, "io.ReadAll(resp.Body)")
5949-
require.Equal(t, string(body), "Hello, World!")
5949+
require.Equal(t, "Hello, World!", string(body))
59505950
}
59515951

59525952
// go test -run Test_Ctx_End_with_drop_middleware
@@ -5956,20 +5956,20 @@ func Test_Ctx_End_with_drop_middleware(t *testing.T) {
59565956
// Middleware that will drop connections
59575957
// that persist after c.Next()
59585958
app.Use(func(c Ctx) error {
5959-
c.Next()
5959+
c.Next() //nolint:errcheck // unnecessary to check error
59605960
return c.Drop()
59615961
})
59625962

59635963
// Early flushing handler
59645964
app.Get("/", func(c Ctx) error {
5965-
c.SendStatus(StatusOK)
5965+
c.SendStatus(StatusOK) //nolint:errcheck // unnecessary to check error
59665966
return c.End()
59675967
})
59685968

59695969
resp, err := app.Test(httptest.NewRequest(MethodGet, "/", nil))
59705970
require.NoError(t, err)
59715971
require.NotNil(t, resp)
5972-
require.Equal(t, resp.StatusCode, 200)
5972+
require.Equal(t, 200, resp.StatusCode)
59735973
}
59745974

59755975
// go test -run Test_Ctx_End_after_drop
@@ -5989,7 +5989,7 @@ func Test_Ctx_End_after_drop(t *testing.T) {
59895989
})
59905990

59915991
resp, err := app.Test(httptest.NewRequest(MethodGet, "/", nil))
5992-
require.Error(t, err)
5992+
require.ErrorIs(t, err, ErrTestGotEmptyResponse)
59935993
require.Nil(t, resp)
59945994
}
59955995

0 commit comments

Comments
 (0)