(b *testing.B)
| 64 | } |
| 65 | |
| 66 | func BenchmarkAllocXML(b *testing.B) { |
| 67 | e := New() |
| 68 | e.Logger = slog.New(slog.DiscardHandler) |
| 69 | req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON)) |
| 70 | rec := httptest.NewRecorder() |
| 71 | c := e.NewContext(req, rec) |
| 72 | |
| 73 | b.ResetTimer() |
| 74 | b.ReportAllocs() |
| 75 | |
| 76 | for i := 0; i < b.N; i++ { |
| 77 | c.XML(http.StatusOK, testUser) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func BenchmarkRealIPForHeaderXForwardFor(b *testing.B) { |
| 82 | c := Context{request: &http.Request{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…