web
web copied to clipboard
Cast string arguments in request path to match handler types
For instance, the route "/([0-9]+), should be able to be passed to the following handler:
func handler ( n int ) string { ... }
I would really like to see something like this
For example in pseudo: /edit/:userId -> func editUser(userId int) in type safe manner
Is this possible?! I'd be very interested in knowing how one would go about this. Pass the handler as interface{}
and use reflect
?