From 4026a11ba646b7110767dd4e547df028666fa6b5 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Mon, 18 Oct 2021 10:28:49 +0300 Subject: [PATCH] chore: add comments --- request.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/request.go b/request.go index ff2bfe3..c002eb0 100644 --- a/request.go +++ b/request.go @@ -21,6 +21,7 @@ func contextWithParams(ctx context.Context, params Params) context.Context { //------------------------------------------------------------------------------ +// HTTPHandler converts http.Handler from the stdlib to bunrouter.HandlerFunc. func HTTPHandler(handler http.Handler) HandlerFunc { return func(w http.ResponseWriter, req Request) error { ctx := contextWithParams(req.Context(), req.params) @@ -29,6 +30,7 @@ func HTTPHandler(handler http.Handler) HandlerFunc { } } +// HTTPHandlerFunc converts http.HandlerFunc from the stdlib to bunrouter.HandlerFunc. func HTTPHandlerFunc(handler http.HandlerFunc) HandlerFunc { return HTTPHandler(http.HandlerFunc(handler)) }