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 function WriteFile() checks if the returned bytes are different from the expected bytes if err=nil. This case will never happen since the Write() function already satisfies that case.
I think this may be related to another previous fix regarding this case.
Propose solution
Delete this if case, since err should be already correctly returned in the previous line.
If this seems correct, I'd like to propose the PR.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
ioutil: no need in WriteFile to explicitly check ErrShortWrite
io/ioutil: no need in WriteFile to explicitly check ErrShortWrite
Jul 11, 2019
Change https://golang.org/cl/185857 mentions this issue: ioutil: no need in WriteFile to explicitly check ErrShortWrite
jsign
changed the title
io/ioutil: no need in WriteFile to explicitly check ErrShortWrite
io/ioutil: don't check for short write in WriteFile
Jul 11, 2019
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputIssue description
The function WriteFile() checks if the returned bytes are different from the expected bytes if
err=nil
. This case will never happen since theWrite()
function already satisfies that case.I think this may be related to another previous fix regarding this case.
Propose solution
Delete this
if
case, sinceerr
should be already correctly returned in the previous line.If this seems correct, I'd like to propose the PR.
The text was updated successfully, but these errors were encountered: