-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid returning 0, nil
in netConn.Read
#367
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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: