Replies: 2 comments
-
@jackc chi.RouteContext(r.Context()).RoutePatterns Hope it helps :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@jackc handlerName := runtime.FuncForPC(reflect.ValueOf(your_handler).Pointer()).Name() However, we can't directly access the original handler function since it's already wrapped by Chi's routing system. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a project with a large number of routes. Many of them have URL params. Some of them are grouped into subrouters.
When I have an issue at a particular URL, sometimes it is difficult to determine what handler is responsible.
For example, given the README.md example routes:
How would I easily find that
PUT /articles/123
was routed to theupdateArticle
function? Obviously, I can go path segment by path segment and eventually find it. But when there are longer paths that can take a little while.I'm somewhat spoiled by the Ruby on Rails logs where it logs the exact method that handled each request.
Beta Was this translation helpful? Give feedback.
All reactions