go test -v -run=^$ -bench=Benchmark_Ctx_OverrideParam -benchmem -count=4
(b *testing.B)
| 9936 | |
| 9937 | // go test -v -run=^$ -bench=Benchmark_Ctx_OverrideParam -benchmem -count=4 |
| 9938 | func Benchmark_Ctx_OverrideParam(b *testing.B) { |
| 9939 | app := New() |
| 9940 | |
| 9941 | ctx := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 9942 | c, ok := ctx.(*DefaultCtx) |
| 9943 | if !ok { |
| 9944 | b.Fatal("AcquireCtx did not return *DefaultCtx") |
| 9945 | } |
| 9946 | |
| 9947 | defer app.ReleaseCtx(c) |
| 9948 | |
| 9949 | c.values = [maxParams]string{"original", "12345"} |
| 9950 | c.route = &Route{Params: []string{"name", "id"}} |
| 9951 | c.setMatched(true) |
| 9952 | |
| 9953 | b.ReportAllocs() |
| 9954 | b.ResetTimer() |
| 9955 | for b.Loop() { |
| 9956 | c.OverrideParam("name", "changed") |
| 9957 | } |
| 9958 | } |
nothing calls this directly
no test coverage detected