-
Notifications
You must be signed in to change notification settings - Fork 56
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
What error should be return if input reader is short than expected? #715
Comments
Due to our Read
It's the user's responsibility to make sure Now, we have the
Write
Well, here is a design decision here, do we need to make it the user's responsibility to make sure In some cases, the user doesn't know how much data is in for {
size, err := br.s.upper.Write(p, r, chunkSize, ps...)
// No matter we read success or not, we both need to send data.
n += size
if err != nil && errors.Is(err, io.EOF) {
break
}
if err != nil {
return n, err
}
} In this code example, However, we can't. Because we MUST make sure that the If we return an error or handle them internally (which is impossible for services like s3, they will use Now, we have these var for this operations:
The user MUST make sure that So there are the following cases:
|
|
Given code like this:
If
r
only has 1MB data, but the user input size is 4MB, do we need to return an error for it?The text was updated successfully, but these errors were encountered: