optimize nolint

This commit is contained in:
Flc゛ 2023-04-27 21:48:44 +08:00 committed by GitHub
parent 98bdb06eee
commit df5c54fd31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,7 @@ func TestContextReset(t *testing.T) {
c.index = 2 c.index = 2
c.Writer = &responseWriter{ResponseWriter: httptest.NewRecorder()} c.Writer = &responseWriter{ResponseWriter: httptest.NewRecorder()}
c.Params = Params{Param{}} c.Params = Params{Param{}}
c.Error(errors.New("test")) // nolint: errcheck c.Error(errors.New("test")) //nolint: errcheck
c.Set("foo", "bar") c.Set("foo", "bar")
c.reset() c.reset()
@ -1382,12 +1382,12 @@ func TestContextError(t *testing.T) {
assert.Empty(t, c.Errors) assert.Empty(t, c.Errors)
firstErr := errors.New("first error") firstErr := errors.New("first error")
c.Error(firstErr) // nolint: errcheck c.Error(firstErr) //nolint: errcheck
assert.Len(t, c.Errors, 1) assert.Len(t, c.Errors, 1)
assert.Equal(t, "Error #01: first error\n", c.Errors.String()) assert.Equal(t, "Error #01: first error\n", c.Errors.String())
secondErr := errors.New("second error") secondErr := errors.New("second error")
c.Error(&Error{ // nolint: errcheck c.Error(&Error{ //nolint: errcheck
Err: secondErr, Err: secondErr,
Meta: "some data 2", Meta: "some data 2",
Type: ErrorTypePublic, Type: ErrorTypePublic,