go test -v -run=^$ -bench=Benchmark_Bind_RespHeader_Map -benchmem -count=4
(b *testing.B)
| 1247 | |
| 1248 | // go test -v -run=^$ -bench=Benchmark_Bind_RespHeader_Map -benchmem -count=4 |
| 1249 | func Benchmark_Bind_RespHeader_Map(b *testing.B) { |
| 1250 | var err error |
| 1251 | app := New() |
| 1252 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 1253 | |
| 1254 | c.Request().SetBody([]byte(``)) |
| 1255 | c.Request().Header.SetContentType("") |
| 1256 | |
| 1257 | c.Response().Header.Add("id", "1") |
| 1258 | c.Response().Header.Add("Name", "John Doe") |
| 1259 | c.Response().Header.Add("Hobby", "golang,fiber") |
| 1260 | |
| 1261 | q := make(map[string][]string) |
| 1262 | b.ReportAllocs() |
| 1263 | for b.Loop() { |
| 1264 | err = c.Bind().RespHeader(&q) |
| 1265 | } |
| 1266 | require.NoError(b, err) |
| 1267 | } |
| 1268 | |
| 1269 | // go test -run Test_Bind_Body_Compression |
| 1270 | func Test_Bind_Body(t *testing.T) { |
nothing calls this directly
no test coverage detected