Skip to content

Commit c5a2f2c

Browse files
committed
Zeus: Fix ParamWrite
1 parent a053452 commit c5a2f2c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ func BenchmarkVulcan_ParamWrite(b *testing.B) {
756756
benchRequest(b, router, r)
757757
}
758758
func BenchmarkZeus_ParamWrite(b *testing.B) {
759-
router := loadZeusSingle("GET", "/user/:name", http.HandlerFunc(patHandlerWrite))
759+
router := loadZeusSingle("GET", "/user/:name", zeusHandlerWrite)
760760

761761
r, _ := http.NewRequest("GET", "/user/gordon", nil)
762762
benchRequest(b, router, r)

routers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,10 @@ func loadVulcanSingle(method, path string, handler http.HandlerFunc) http.Handle
10791079
}
10801080

10811081
// Zeus
1082+
func zeusHandlerWrite(w http.ResponseWriter, r *http.Request) {
1083+
io.WriteString(w, zeus.Var(r, "name"))
1084+
}
1085+
10821086
func loadZeus(routes []route) http.Handler {
10831087
m := zeus.New()
10841088
for _, route := range routes {

0 commit comments

Comments
 (0)