You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also check out this example which seemingly proves that a struct that embeds an interface cannot be type asserted to another interface that the struct itself doesn't implement even if the embedded struct implements the second interface.
Proposal:
type assert the http.ResponseWriter in wrapWriter and use a new struct that implements http.Flusher, http.CloseNotifierand http.Hijacker if the ResponseWriter does. Similar to this perhaps?
The text was updated successfully, but these errors were encountered:
consider the following test code (mostly copied from this repo's README)
the results:
Also check out this example which seemingly proves that a struct that embeds an interface cannot be type asserted to another interface that the struct itself doesn't implement even if the embedded struct implements the second interface.
Proposal:
type assert the
http.ResponseWriter
inwrapWriter
and use a new struct that implementshttp.Flusher
,http.CloseNotifier
andhttp.Hijacker
if the ResponseWriter does. Similar to this perhaps?The text was updated successfully, but these errors were encountered: