change the websocket.Upgrade
function signature
#27
bestgopher
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current the
Upgrade
function take ahttp.ResponseWriter
as first argument, but if the argument is not implemented thehttp.Hijacker
interface, an error will be raised at running time.I think the better way is check the argument is valid at compile time.
We can define a new interface that combines the
http.ResponseWriter
andhttp.Hijacker
. And then change theUpgrade
function .Beta Was this translation helpful? Give feedback.
All reactions