-
Notifications
You must be signed in to change notification settings - Fork 315
Avoid returning 0, nil
in netConn.Read
#367
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
Milestone
Comments
Will change because the docs for io.Reader discourage it but if your code is using |
How do you think you want to solve it? Loop until error or data? Or something else? I'm happy to submit a patch. |
Related golang/go#27531 (comment) |
nhooyr
added a commit
that referenced
this issue
Oct 13, 2023
Fixed in dev. |
nhooyr
added a commit
that referenced
this issue
Oct 13, 2023
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
When we reach the end of the frame we currently return
0, nil
(https://github.com/nhooyr/websocket/blob/master/netconn.go#L118). Theio.Reader
docs discourage this:This seems to have confused other folks as well: #353
My recommendation is we don't return 0, nil and instead block until we get data or a proper error.
The text was updated successfully, but these errors were encountered: