Joe Tsai
b72a4a07c2
encoding/binary: document that Read returns io.EOF iff zero bytes are read
...
Also add a unit test to lock this behavior into the API.
Fixes #12016
Change-Id: Ib6ec6e7948f0705f3504ede9143b5dc4e790fc44
Reviewed-on: https://go-review.googlesource.com/15171
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-09-30 22:10:44 +00:00
Dmitry Savintsev
fac7b86a9b
encoding/binary: update protobuf documentation link
...
Updated the protobuf documentation URL (code.google.com deprecated)
to avoid a redirect.
Change-Id: I134f6e4a2bf2bba699942883bf6347bc61700bcb
Reviewed-on: https://go-review.googlesource.com/11634
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-29 14:28:01 +00:00
Josh Bleecher Snyder
facd79e4be
encoding/binary: cull dead code
...
Change-Id: I91f9b5280e08e005f5a891aaa249267c211d814b
Reviewed-on: https://go-review.googlesource.com/7592
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-14 02:51:22 +00:00
Stan Schwertly
a48e789635
encoding/binary: check for unsigned integers in intDataSize.
...
intDataSize ignores unsigned integers, forcing reads/writes to miss the fast path.
Fixes #8956
Change-Id: Ie79b565b037db3c469aa1dc6d0a8a5a9252d5f0a
Reviewed-on: https://go-review.googlesource.com/1777
Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-22 20:14:59 +00:00
Robert Griesemer
1dba6eb464
encoding/binary: fix error message
...
In the process, simplified internal sizeOf and
dataSize functions. Minor positive impact on
performance. Added test case.
benchmark old ns/op new ns/op delta
BenchmarkReadSlice1000Int32s 14006 14122 +0.83%
BenchmarkReadStruct 2508 2447 -2.43%
BenchmarkReadInts 921 928 +0.76%
BenchmarkWriteInts 2086 2081 -0.24%
BenchmarkWriteSlice1000Int32s 13440 13497 +0.42%
BenchmarkPutUvarint32 28.5 26.3 -7.72%
BenchmarkPutUvarint64 81.3 76.7 -5.66%
benchmark old MB/s new MB/s speedup
BenchmarkReadSlice1000Int32s 285.58 283.24 0.99x
BenchmarkReadStruct 27.90 28.60 1.03x
BenchmarkReadInts 32.57 32.31 0.99x
BenchmarkWriteInts 14.38 14.41 1.00x
BenchmarkWriteSlice1000Int32s 297.60 296.36 1.00x
BenchmarkPutUvarint32 140.55 151.92 1.08x
BenchmarkPutUvarint64 98.36 104.33 1.06x
Fixes #6818 .
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/149290045
2014-10-02 12:53:51 -07:00
Robert Griesemer
94f3d8cfed
encoding/binary: slightly better documentation
...
Fixes #7306 .
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/153820044
2014-10-01 16:09:55 -07:00
Russ Cox
c007ce824d
build: move package sources from src/pkg to src
...
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.
2014-09-08 00:08:51 -04:00