Hi,

I'm learning Go and start a Restful TO-DO app project for practicing. In 
the process, I would like to add the Field Selector. I had searching on 
google last few hours for a way to intercept the response and strip out the 
unnecessary parts. I tried out some of them which either doesn't work at 
all to having error with other functions. Methods I tried include 

   - custom ResponseWriter struct which isn't compaible with HandlerFunc(). 
   It said it can't take a custom ResponseWriter but only http.ResponseWriter
   - wrapper style described in The http.Handler wrapper technique in 
   #golang UPDATED which doesn't work at all
   - middleware style showed in Writing middleware in #golang and how Go 
   makes it so much fun. 
   
<https://medium.com/@matryer/writing-middleware-in-golang-and-how-go-makes-it-so-much-fun-4375c1246e81>
 
   which Handler() complain my other handler (the route logic) doesn't have 
   ServeHTTP() implemented. 

I know I can just strip the JSON before writing to ResponseWriter but I 
want it to apply automatically for every request which I doesn't need to 
add a piece/line of code every time before writing anything to 
ResponseWriter.

Please sent help.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to