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
The example programs create and discard bufio.Readers in inner loops. Any data buffered in the bufio.Reader is also discarded. The discarded data may not be an issue in your tests cases, but people are copying your code to their own applications where things break.
This error is common in network programming questions on StackOverflow. I suspect that many of the questioners are getting their code from this page.
Link: https://linode.com/docs/development/go/developing-udp-and-tcp-clients-and-servers-in-go/
Issue
The example programs create and discard bufio.Readers in inner loops. Any data buffered in the bufio.Reader is also discarded. The discarded data may not be an issue in your tests cases, but people are copying your code to their own applications where things break.
This error is common in network programming questions on StackOverflow. I suspect that many of the questioners are getting their code from this page.
Suggested Fix
Change code like this:
To
All uses of bufio.NewReader in the example programs have this problem. Fix all of them.
Hall of Shame (SO questions that follow the bad advice in the Linode article):
The text was updated successfully, but these errors were encountered: