Skip to content

Commit

Permalink
fix lint errors (Cookie parser #2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
René Werner committed Oct 12, 2023
1 parent 8d088e9 commit bb026a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,6 @@ func Test_Ctx_CookieParserUsingTag(t *testing.T) {
c.Request().Header.Set("Cookie", "dates[]=7,6,10")
utils.AssertEqual(t, nil, c.CookieParser(ac))
utils.AssertEqual(t, 3, len(ac.Dates))

}

// go test -run Test_Ctx_CookieParserSchema -v
Expand Down Expand Up @@ -1038,8 +1037,8 @@ func Test_Ctx_CookieParser_Schema(t *testing.T) {
c.Request().Header.Set("Cookie", "result.maths=10")
c.Request().Header.Set("Cookie", "result.english=10")
hR := new(resStruct)
c.CookieParser(hR)

utils.AssertEqual(t, nil, c.CookieParser(hR))
utils.AssertEqual(t, *res, *hR)
t.Log(*hR)
}
Expand Down Expand Up @@ -1067,10 +1066,13 @@ func Benchmark_Ctx_CookieParser(b *testing.B) {
c.Request().Header.Set("Cookie", "fee=45.78")
c.Request().Header.Set("Cookie", "score=7,6,10")

var err error
// Run the function b.N times
for i := 0; i < b.N; i++ {
_ = c.CookieParser(cookie1)
err = c.CookieParser(cookie1)
}

utils.AssertEqual(b, nil, err)
}

// go test -run Test_Ctx_Cookies
Expand Down

0 comments on commit bb026a6

Please sign in to comment.