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
net/http: ServeContent to return bytes copied end error #9709
Comments
But it would break compatibility for anyone that's using To do what you want, you could wrap the |
No, I can't wrap cause I still could not access bytes copied (and it is primary reason for issue). At the moment, I see that it looks like I ought to copy whole ServeContent implementation to achieve goal. |
may be there is possibility to make |
You can wrap both the
|
Yes, we can't change the signature of things due to the Go 1 API compatibility promise. |
But you can expose new function: just make private function 'serveContent' to be a public one with non colliding name, and make it return bytes and error. |
ServeContent hasn't changed in years. If you want to access its internals, just make a copy. |
And now I do not offer to change |
Your minor convenience isn't worth the cost of all other Go programmer's increased cognitive load required by having more stuff in the Sorry, we're not adding this. There are ways to do this already. Unless a large number/percentage of people needed this, it's not worth the cost of adding it. |
It will be good if http.ServeContent will return number of bytes copied and error.
It should not break API compatibility, cause it doesn't return anything at the moment.
The text was updated successfully, but these errors were encountered: