- 06 May, 2016 1 commit
-
-
Joe Tsai authored
CL/19862 (f79b50b8) recently introduced the constants SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants consistently throughout the code base. Updates #15269 Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2 Reviewed-on: https://go-review.googlesource.com/22097 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@digital-static.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 12 Apr, 2016 1 commit
-
-
Dan Peterson authored
Fixes #13849 Change-Id: Idd7f06b547a0179fe15571807a8c48b7c3b78d7c Reviewed-on: https://go-review.googlesource.com/21852 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 08 Apr, 2016 1 commit
-
-
Rob Pike authored
This is a proposal. The old name is pretty poor. The new one describes it better and may be easier to remember. It does not start with Read, though I think that inconsistency is worthwhile. Reworded the comment a bit for clarity. Change-Id: Icb4f9c663cc68958e0363d7ff78a0b29cc521f98 Reviewed-on: https://go-review.googlesource.com/21629 Reviewed-by:
Andrew Gerrand <adg@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 06 Apr, 2016 1 commit
-
-
Brad Fitzpatrick authored
ReadAtSizer is a common abstraction for a stateless, concurrently-readable fixed number of bytes. This interface has existed in various codebases for over 3 years (previously usually named SizeReaderAt). It is used inside Google in dl.google.com (mentioned in https://talks.golang.org/2013/oscon-dl.slide) and other packages. It is used in Camlistore, in Juju, in the Google API Go client, in github.com/nightlyone/views, and 33 other pages of Github search results. It is implemented by io.SectionReader, bytes.Reader, strings.Reader, etc. Time to finally promote this interface to the standard library and give it a standard name, blessing it as best practice. Updates #7263 Updates #14889 Change-Id: Id28c0cafa7d2d37e8887c54708b5daf1b11c83ea Reviewed-on: https://go-review.googlesource.com/21492 Reviewed-by:
Rob Pike <r@golang.org>
-
- 05 Apr, 2016 1 commit
-
-
Eric Lagergren authored
Fixes #6885 Change-Id: I6907958186f6a2427da1ad2f6c20bd5d7bf7a3f9 Reviewed-on: https://go-review.googlesource.com/19862 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 02 Mar, 2016 1 commit
-
-
Brad Fitzpatrick authored
The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022 Reviewed-by:
Rob Pike <r@golang.org> Reviewed-by:
Dave Day <djd@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 29 Feb, 2016 1 commit
-
-
Brad Fitzpatrick authored
Named returned values should only be used on public funcs and methods when it contributes to the documentation. Named return values should not be used if they're only saving the programmer a few lines of code inside the body of the function, especially if that means there's stutter in the documentation or it was only there so the programmer could use a naked return statement. (Naked returns should not be used except in very small functions) This change is a manual audit & cleanup of public func signatures. Signatures were not changed if: * the func was private (wouldn't be in public godoc) * the documentation referenced it * the named return value was an interesting name. (i.e. it wasn't simply stutter, repeating the name of the type) There should be no changes in behavior. (At least: none intended) Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109 Reviewed-on: https://go-review.googlesource.com/20024 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 06 Oct, 2015 2 commits
-
-
Joe Tsai authored
Let C be whether c valid Let E be whether err is non-nil The old comment explicitly says that (~C → E). However, that does call into question whether (E → ~C), which causes doubts for users. Without a comment at all, it is obvious that only (E
↔ ~C) makes sense. Fixes #11308 Change-Id: I5a7d51ceb509057eccca91f57a7e48c9d1c6d112 Reviewed-on: https://go-review.googlesource.com/15256 Reviewed-by:Andrew Gerrand <adg@golang.org>
-
Joe Tsai authored
The later part of the docstring simply talks about "offset" but does not disambiguate what it is relative to. For both the return value and valid offsets to seek to, it only makes sense in the context of "offset relative to origin of file". Fixes #11877 Change-Id: Ic238a407cf8e8fdd64991d98a6584cdc8a51cd6b Reviewed-on: https://go-review.googlesource.com/15257 Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 29 Jun, 2015 1 commit
-
-
Russ Cox authored
I think this has the same meaning as before, but the text is tighter, and it makes some people happy. Fixes #10182. Change-Id: I7ee1eae4bcd6ee4a5898ea948648939e6bde5f01 Reviewed-on: https://go-review.googlesource.com/11674 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Rob Pike <r@golang.org>
-
- 29 May, 2015 1 commit
-
-
David Symonds authored
Change-Id: Iddcd0cfb8f2c2f1c4ad7a94b50a9f65b543862c4 Reviewed-on: https://go-review.googlesource.com/10473 Reviewed-by:
Minux Ma <minux@golang.org>
-
- 15 Apr, 2015 1 commit
-
-
Rob Pike authored
This trivial addition to the io package makes it easy to control the buffer size and allocation properties of io.Copy. Change-Id: Ica1a6bd015e429d4e655bc0c6f66cea21c454acf Reviewed-on: https://go-review.googlesource.com/8730 Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 08 Apr, 2015 1 commit
-
-
Péter Surányi authored
"returns ... the first error" was misleading or at least confusing: in case a Read results in an error with non-zero bytes read, and the subsequent Write also results in an error, the error from Write is returned, which is the second one (in the temporal dimension). Fixes #9744 Change-Id: If8925a701e4fae820cd9df7446503403fc0785d4 Reviewed-on: https://go-review.googlesource.com/3686 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 16 Sep, 2014 1 commit
-
-
Russ Cox authored
Fixes #8317. LGTM=bradfitz R=bradfitz, iant, r CC=golang-codereviews https://golang.org/cl/143100043
-
- 08 Sep, 2014 1 commit
-
-
Russ Cox authored
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
-
- 26 Aug, 2014 1 commit
-
-
Brad Fitzpatrick authored
There are both many callers and many implementations of these interfaces, so make the contract explicit. Callers generally assume this, and at least the standard library and other implementations obey this, but it's never stated explicitly, making it somewhat risky to assume. LGTM=gri, rsc R=golang-codereviews, gri CC=golang-codereviews, r, rsc https://golang.org/cl/132150043
-
- 16 Apr, 2014 1 commit
-
-
Brad Fitzpatrick authored
Per golang-nuts question. Writing to p breaks other writers (e.g. io.MultiWriter). Make this explicit. LGTM=gri, r, rsc R=r, rsc, gri, joshlf13 CC=golang-codereviews https://golang.org/cl/87780046
-
- 18 Jul, 2013 1 commit
-
-
Brad Fitzpatrick authored
Be consistent with os.File, strings.Reader, bytes.Reader, etc, which all allow seeks past the end. R=golang-dev, r CC=golang-dev https://golang.org/cl/11403043
-
- 23 May, 2013 1 commit
-
-
Daniel Morsing authored
This only affects calls where both ReaderFrom and WriterTo are implemented. WriterTo can issue one large write, while ReaderFrom must Read until EOF, potentially reallocating when out of memory. With one large Write, the Writer only needs to allocate once. This also helps in ioutil.Discard since we can avoid copying memory when the Reader implements WriterTo. R=golang-dev, dsymonds, remyoudompheng, bradfitz CC=golang-dev, minux.ma https://golang.org/cl/9462044
-
- 19 Apr, 2013 1 commit
-
-
Rob Pike authored
Also add a new variable ErrNoProgress that io.Readers can use to report ineffectual Read calls. Fixes #5310. R=golang-dev, dsymonds, bradfitz CC=golang-dev https://golang.org/cl/8845043
-
- 09 Apr, 2013 1 commit
-
-
Brad Fitzpatrick authored
R=r, golang-dev CC=golang-dev https://golang.org/cl/8575043
-
- 13 Feb, 2013 1 commit
-
-
Brad Fitzpatrick authored
Changed accidentally in 28966b7b2f0c (CopyN using Copy). Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast) R=rsc CC=golang-dev https://golang.org/cl/7314069
-
- 08 Feb, 2013 1 commit
-
-
Jeremy Schlatter authored
R=golang-dev, dave, minux.ma, bradfitz, rsc CC=golang-dev https://golang.org/cl/7312055
-
- 31 Jan, 2013 1 commit
-
-
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
-
- 13 Dec, 2012 1 commit
-
-
Shenghou Ma authored
Fixes #4392. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6858062
-
- 30 Oct, 2012 1 commit
-
-
Brad Fitzpatrick authored
API change. R=golang-dev, dsymonds, nigeltao, rsc, r CC=golang-dev https://golang.org/cl/6760045
-
- 08 Aug, 2012 1 commit
-
-
Andrew Gerrand authored
R=r CC=golang-dev https://golang.org/cl/6458097
-
- 07 Aug, 2012 1 commit
-
-
Brad Fitzpatrick authored
Fixes #3711 R=golang-dev, adg CC=golang-dev https://golang.org/cl/6445083
-
- 08 Mar, 2012 1 commit
-
-
Francisco Souza authored
R=adg, bradfitz CC=golang-dev https://golang.org/cl/5787048
-
- 07 Mar, 2012 1 commit
-
-
Brad Fitzpatrick authored
Updates #1599 R=golang-dev, gri, rsc CC=golang-dev https://golang.org/cl/5774043
-
- 01 Mar, 2012 1 commit
-
-
Rob Pike authored
Updates #1599. R=golang-dev, bradfitz, rsc, r CC=golang-dev https://golang.org/cl/5708056
-
- 29 Feb, 2012 1 commit
-
-
Rob Pike authored
Updates #1599. R=golang-dev, adg, dsymonds CC=golang-dev https://golang.org/cl/5704052
-
- 06 Feb, 2012 1 commit
-
-
Rob Pike authored
- eliminate local Error type (a historical artifact) - fix documentation of CopyN - fix documentation of WriteString Fixes #2859. R=rsc, bradfitz CC=golang-dev https://golang.org/cl/5636046
-
- 02 Nov, 2011 1 commit
-
-
Russ Cox authored
R=r, r CC=golang-dev https://golang.org/cl/5311068
-
- 26 Oct, 2011 1 commit
-
-
Russ Cox authored
ReadRune, WriteRune change signature. R=golang-dev, gri, r CC=golang-dev https://golang.org/cl/5314043
-
- 30 Sep, 2011 1 commit
-
-
David Symonds authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/5157045
-
- 26 Aug, 2011 1 commit
-
-
Hector Chu authored
TeeReader is a Reader that writes what it reads. R=rsc, bradfitz CC=golang-dev https://golang.org/cl/4953041
-
- 28 Jun, 2011 1 commit
-
-
Evan Shaw authored
This avoids allocation when writing to bytes.Buffers and bufio.Writers, for example. R=golang-dev, rsc, r, consalus, r CC=golang-dev https://golang.org/cl/4625068
-
- 22 Jun, 2011 2 commits
-
-
Russ Cox authored
R=golang-dev, bradfitz, iant, dsymonds, nigeltao, r CC=golang-dev https://golang.org/cl/4629062
-
Robert Griesemer authored
This is a core API change. 1) gofix misc src 2) Manual adjustments to the following files under src/pkg: gob/decode.go rpc/client.go os/error.go io/io.go bufio/bufio.go http/request.go websocket/client.go as well as: src/cmd/gofix/testdata/*.go.in (reverted) test/fixedbugs/bug243.go 3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go) Compiles and runs all tests. R=r, rsc, gri CC=golang-dev https://golang.org/cl/4607052
-