Skip to content

Commit

Permalink
Fix golangci-lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby authored Dec 7, 2024
1 parent 829d6cf commit 3c3fa8c
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,9 @@ func Test_Bind_Body(t *testing.T) {

buf := &bytes.Buffer{}
writer := multipart.NewWriter(buf)
writer.WriteField("data.0.name", "john")
writer.WriteField("data.1.name", "doe")
writer.Close()
require.NoError(t, writer.WriteField("data.0.name", "john"))
require.NoError(t, writer.WriteField("data.1.name", "doe"))
require.NoError(t, writer.Close())

c.Request().Header.SetContentType(writer.FormDataContentType())
c.Request().SetBody(buf.Bytes())
Expand All @@ -1016,9 +1016,9 @@ func Test_Bind_Body(t *testing.T) {

buf := &bytes.Buffer{}
writer := multipart.NewWriter(buf)
writer.WriteField("data[0][name]", "john")
writer.WriteField("data[1][name]", "doe")
writer.Close()
require.NoError(t, writer.WriteField("data[0][name]", "john"))
require.NoError(t, writer.WriteField("data[1][name]", "doe"))
require.NoError(t, writer.Close())

c.Request().Header.SetContentType(writer.FormDataContentType())
c.Request().SetBody(buf.Bytes())
Expand Down Expand Up @@ -1235,9 +1235,8 @@ func Benchmark_Bind_Body_MultipartForm(b *testing.B) {

buf := &bytes.Buffer{}
writer := multipart.NewWriter(buf)
writer.WriteField("name", "john")

writer.Close()
require.NoError(t, writer.WriteField("name", "john"))

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t

Check failure on line 1238 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.Close())

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t

Check failure on line 1239 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
body := buf.Bytes()

c.Request().SetBody(body)
Expand Down Expand Up @@ -1275,13 +1274,12 @@ func Benchmark_Bind_Body_MultipartForm_Nested(b *testing.B) {

buf := &bytes.Buffer{}
writer := multipart.NewWriter(buf)
writer.WriteField("name", "john")
writer.WriteField("persons.0.name", "john")
writer.WriteField("persons[0][age]", "10")
writer.WriteField("persons[1][name]", "doe")
writer.WriteField("persons.1.age", "20")

writer.Close()
require.NoError(t, writer.WriteField("name", "john"))

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1277 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.WriteField("persons.0.name", "john"))

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1278 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.WriteField("persons[0][age]", "10"))

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1279 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.WriteField("persons[1][name]", "doe"))

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1280 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.WriteField("persons.1.age", "20"))

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1281 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
require.NoError(t, writer.Close())

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: t (typecheck)

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, ubuntu-latest)

undefined: t

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-13)

undefined: t

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / unit (1.23.x, macos-latest)

undefined: t

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / Compare

undefined: t

Check failure on line 1282 in bind_test.go

View workflow job for this annotation

GitHub Actions / repeated

undefined: t
body := buf.Bytes()

c.Request().SetBody(body)
Expand Down

0 comments on commit 3c3fa8c

Please sign in to comment.