23 lines
425 B
Go
Raw Normal View History

2024-03-13 22:16:52 +00:00
package main_test
import (
"testing"
"github.com/beego/beego/v2/server/web"
"github.com/beego/beego/v2/server/web/context"
)
func BenchmarkBeego(b *testing.B) {
bench(
b,
func() *web.ControllerRegister {
return web.NewControllerRegister()
},
func(s *web.ControllerRegister, method string, path string) {
s.AddMethod(method, path, func(ctx *context.Context) {
ctx.Output.Body(payload)
})
},
)
}