downsides of wrapping ResponseWriter
tl;dr: ResponseWriter's optional interfaces spoil the fun, when you try to compose it in this (or any) way.
The issue is, that the wrapping type now hides all the optional interfaces,
ResponseWritersupports (namely Flusher, Pusher, Hijacker and CloseNotifier.
Even if the embedded
ResponseWriterimplements them, the type
statusRecorderwon't; it will only have the methods that are explicitly declared for it, plus the ones from embedded interfaces, that are known at compile time.
I hadn't considered the downisdes of wrapping ResponseWriter (which I've always done immediately) before.
Flusher means losing the ability to write chunked responses which is The Weirdly Obscure Art of Streamed HTML