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 main question: is it guaranteed that Write method of http.ResponseWriter either returns non-nil error or writes all the data?
If not, then it should be encouraged to use io.Copy(rw, bytes.NewReader(...)). Somehow I'm sure, that a lot of code already relies on full writes and my proposed construction isn't elegant for such boilerplate code
If yes, I would propose to add the guarantee to the comment for Write method
I believe that the guarantee should be provided, because the alternative is unobvious and adds unnecessary boilerplate, opposed to the maintenance of the property
The text was updated successfully, but these errors were encountered:
@seankhliao I mean it would be great to document it in the interface itself, not every instance of course. This should be a requirement for any implementation even
The main question: is it guaranteed that Write method of http.ResponseWriter either returns non-nil error or writes all the data?
If not, then it should be encouraged to use
io.Copy(rw, bytes.NewReader(...))
. Somehow I'm sure, that a lot of code already relies on full writes and my proposed construction isn't elegant for such boilerplate codeIf yes, I would propose to add the guarantee to the comment for Write method
I believe that the guarantee should be provided, because the alternative is unobvious and adds unnecessary boilerplate, opposed to the maintenance of the property
The text was updated successfully, but these errors were encountered: