• Russ Cox's avatar
    io: guarantee err == nil for full reads in ReadFull and ReadAtLeast · 662ff542
    Russ Cox authored
    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 #4544.
    
    R=golang-dev, bradfitz, minux.ma
    CC=golang-dev
    https://golang.org/cl/7235074
    662ff542
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...