@@ -39,12 +39,12 @@ lots of advise and code examples that suggest it to be a fairly trivial
3939undertaking. Unfortunately everything I've seen so far has a high chance of
4040breaking your application.
4141
42- The main problem is that a http.ResponseWriter often implements additional
43- interfaces such as http.Flusher, http.CloseNotifier, http.Hijacker and
44- io.ReaderFrom. So the naive approach of just wrapping http.ResponseWriter in
45- your own struct implementing the same interface will hide the additional
46- interfaces mentioned above. This has a high change of introducing subtle bugs
47- into any non-trivial application.
42+ The main problem is that a ` http.ResponseWriter ` often implements additional
43+ interfaces such as ` http.Flusher ` , ` http.CloseNotifier ` , ` http.Hijacker ` and
44+ ` io.ReaderFrom ` . So the naive approach of just wrapping ` http.ResponseWriter `
45+ in your own struct that also implements the ` http.ResponseWriter ` interface
46+ will hide the additional interfaces mentioned above. This has a high change of
47+ introducing subtle bugs into any non-trivial application.
4848
4949Another approach I've seen people take is to return a struct that implements
5050all of the interfaces above. However, that's also problematic, because it's
@@ -59,8 +59,8 @@ exact same set of interfaces.
5959
6060Additionally this package properly handles edge cases such as WriteHeader not
6161being called, or called more than once, as well as concurrent calls to
62- http.ResponseWriter methods, and even calls happening after the wrapped
63- ServeHTTP has already returned.
62+ ` http.ResponseWriter ` methods, and even calls happening after the wrapped
63+ ` ServeHTTP ` has already returned.
6464
6565Unfortunately this package is not perfect either. It's possible that it is
6666still missing some interfaces provided by the go core (let me know if you find
0 commit comments