diff options
| author | Mathieu Lonjaret <mathieu.lonjaret@gmail.com> | 2013-08-27 06:32:24 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2013-08-27 06:32:24 -0700 |
| commit | d5c806d581f4d110dfc2696c8b18b4ecde82e453 (patch) | |
| tree | 1e8b20f0c177d4ee2a5f959dc7d04d57318b297c /src/pkg/encoding/binary | |
| parent | 11320fa500c7201065baf1958e237ce4a03b3030 (diff) | |
| download | go-d5c806d581f4d110dfc2696c8b18b4ecde82e453.tar.xz | |
encoding/binary: use bytes.Reader in read example
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/13274043
Diffstat (limited to 'src/pkg/encoding/binary')
| -rw-r--r-- | src/pkg/encoding/binary/example_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/encoding/binary/example_test.go b/src/pkg/encoding/binary/example_test.go index dec12ebf5d..067cf553be 100644 --- a/src/pkg/encoding/binary/example_test.go +++ b/src/pkg/encoding/binary/example_test.go @@ -42,7 +42,7 @@ func ExampleWrite_multi() { func ExampleRead() { var pi float64 b := []byte{0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40} - buf := bytes.NewBuffer(b) + buf := bytes.NewReader(b) err := binary.Read(buf, binary.LittleEndian, &pi) if err != nil { fmt.Println("binary.Read failed:", err) |
