23 lines
366 B
Go
23 lines
366 B
Go
package main_test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/matryer/way"
|
|
)
|
|
|
|
func BenchmarkWay(b *testing.B) {
|
|
bench(
|
|
b,
|
|
func() *way.Router {
|
|
return way.NewRouter()
|
|
},
|
|
func(r *way.Router, method string, path string) {
|
|
r.HandleFunc(method, path, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Write(payload)
|
|
}))
|
|
},
|
|
)
|
|
}
|