Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Issue 7235074: code review 7235074: io: guarantee err == nil for full reads in ReadFull and... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by rsc
Modified:
12 years, 5 months ago
Reviewers:
dave
CC:
golang-dev, bradfitz, minux1
Visibility:
Public.

Description

io: guarantee err == nil for full reads in ReadFull and ReadAtLeast This is a backwards compatible API change that fixes broken code. In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or len(buf), non-nil. Most code expects only the former, so do that and document the guarantee. Code that was correct before is still correct. Code that was incorrect before, by assuming the guarantee, is now correct too. The same applies to ReadAtLeast. Fixes issue 4544.

Patch Set 1 #

Patch Set 2 : diff -r 58e1987657d6 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 58e1987657d6 https://code.google.com/p/go/ #

Patch Set 4 : diff -r bb293c428338 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -13 lines) Patch
M src/pkg/io/io.go View 1 3 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/io/io_test.go View 1 3 chunks +20 lines, -7 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 5 months ago (2013-01-31 17:12:27 UTC) #1
bradfitz
LGTM On Thu, Jan 31, 2013 at 9:12 AM, <rsc@golang.org> wrote: > Reviewers: golang-dev_googlegroups.com, > ...
12 years, 5 months ago (2013-01-31 17:23:48 UTC) #2
minux1
awesome, thank you!
12 years, 5 months ago (2013-01-31 17:28:18 UTC) #3
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=29bf5ff5064e *** io: guarantee err == nil for full reads in ReadFull ...
12 years, 5 months ago (2013-01-31 21:47:10 UTC) #4
dave_cheney.net
12 years, 5 months ago (2013-01-31 22:00:44 UTC) #5
There may have been a test regression due to this change. 

http://build.golang.org/log/f779a324b4d0c9ab6ed5074e6d355b8804f963c3

(And others)

On 01/02/2013, at 8:47, rsc@golang.org wrote:

> *** Submitted as
> https://code.google.com/p/go/source/detail?r=29bf5ff5064e ***
> 
> io: guarantee err == nil for full reads in ReadFull and ReadAtLeast
> 
> This is a backwards compatible API change that fixes broken code.
> 
> In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or
> len(buf), non-nil.
> Most code expects only the former, so do that and document the
> guarantee.
> 
> Code that was correct before is still correct.
> Code that was incorrect before, by assuming the guarantee, is now
> correct too.
> 
> The same applies to ReadAtLeast.
> 
> Fixes issue 4544.
> 
> R=golang-dev, bradfitz, minux.ma
> CC=golang-dev
> https://codereview.appspot.com/7235074
> 
> 
> https://codereview.appspot.com/7235074/
> 
> -- 
> 
> ---You received this message because you are subscribed to the Google Groups
"golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to golang-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b