I have a server that I am writing, and I want to handle errors from conn.Read(). Specifically, I want to do nothing in the case that the client has closed the connection, but log the error if it is any other error. I have encountered the following problems:
- The documentation does not seem to say what the errors that conn.Read() can return.
- Connection-closed-by-client seems to be an EOF error. Turns out that it's type is error.errorString. Seriously?
So basically I have to do a string comparison to "EOF" to tell if my error is expected or a genuine error?!? Am I missing something? Because this seems like a huge oversight at the moment...