On Thu, Nov 10, 2016, at 11:09 AM, Felix Geisendoerfer wrote: > I would love for net/http experts to take a look at the "Why this > package exists" section of the README, as well as the horrible hack > required to make things work: > > https://github.com/felixge/httpsnoop/blob/master/wrap.go#L44-L163 > > Please let me know if you have suggestions for simpler approaches > and/or spot any bugs in my implementation. >
Did you think about performing a type assertion in the rw struct methods like this: func (w *rw) Flush() { if f, ok := w.w.(http.Flusher); ok { f.Flush() } } I haven't tried it myself, but it's what came to mind when reading your Wrap "abomination" (as you call it in the code). -- 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.