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
Uh oh!
There was an error while loading. Please reload this page.
-
Current the
Upgradefunction take ahttp.ResponseWriteras first argument, but if the argument is not implemented thehttp.Hijackerinterface, 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.ResponseWriterandhttp.Hijacker. And then change theUpgradefunction .Beta Was this translation helpful? Give feedback.
All reactions