go-martini / martini

Classy web framework for Go
martini.codegangsta.io
MIT License
11.63k stars 1.1k forks source link

typecheck arguments on boot-up #425

Open ORESoftware opened 4 years ago

ORESoftware commented 4 years ago

So we have this:

m.Get("/cp/users/subresource/email", common.AsJson, common.RequestTimer, ctr.CreateEmail)

could we not tell martini to type check the arguments to make sure all types are represented, perhaps by returning the type of each argument from:

common.AsJson, common.RequestTimer,

furthermore if there are two many arguments to ctr.CreateEmail it could also barf on load?