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

@@ -14,7 +14,7 @@ func TestParseHeaders(t *testing.T) {
Baz int `header:"baz"`
Qux bool `header:"qux,default=true"`
}
r := httptest.NewRequest(http.MethodGet, "/any", nil)
r := httptest.NewRequest(http.MethodGet, "/any", http.NoBody)
r.Header.Set("foo", "bar")
r.Header.Set("baz", "1")
assert.Nil(t, ParseHeaders(r.Header, &val))
@@ -29,7 +29,7 @@ func TestParseHeadersMulti(t *testing.T) {
Baz int `header:"baz"`
Qux bool `header:"qux,default=true"`
}
r := httptest.NewRequest(http.MethodGet, "/any", nil)
r := httptest.NewRequest(http.MethodGet, "/any", http.NoBody)
r.Header.Set("foo", "bar")
r.Header.Add("foo", "bar1")
r.Header.Set("baz", "1")
@@ -43,7 +43,7 @@ func TestParseHeadersArrayInt(t *testing.T) {
var val struct {
Foo []int `header:"foo"`
}
r := httptest.NewRequest(http.MethodGet, "/any", nil)
r := httptest.NewRequest(http.MethodGet, "/any", http.NoBody)
r.Header.Set("foo", "1")
r.Header.Add("foo", "2")
assert.Nil(t, ParseHeaders(r.Header, &val))