Hi,

I'm quite happy about the generics so far, but now I'm trying some ideas 
that I don't know if they are possible or not given the current proposal.
My idea, is to create some kind of generic handler for "net/http" that 
could be used in a whole project.
It would allow same behavior on each routes (unmarshalling the request, 
validating it, calling the real business logic with a func(Request) 
(Response, error) style, handling the business logic error, marshalling the 
response).
This is currently impossible (that I know) without using some bad hacks 
(using an unmarshalling middleware and storing it in the context.Context), 
etc.

So here is my attempt using generics, but my example stopped on this error:

https://go2goplay.golang.org/p/NyvV47ozr7S

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/55b80a81-aacf-4de4-bc0f-4cc2d72661e9o%40googlegroups.com.

Reply via email to