Commit 0c841569 authored by Rob Pike's avatar Rob Pike

doc/effective_go.html: fix typo

Prose referred to 'b', code used 'buf'.
Fixes #7601.

LGTM=dominik.honnef
R=golang-codereviews, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/78470043
parent 0285d2b9
...@@ -1386,8 +1386,9 @@ func (file *File) Read(buf []byte) (n int, err error) ...@@ -1386,8 +1386,9 @@ func (file *File) Read(buf []byte) (n int, err error)
</pre> </pre>
<p> <p>
The method returns the number of bytes read and an error value, if The method returns the number of bytes read and an error value, if
any. To read into the first 32 bytes of a larger buffer any.
<code>b</code>, <i>slice</i> (here used as a verb) the buffer. To read into the first 32 bytes of a larger buffer
<code>buf</code>, <i>slice</i> (here used as a verb) the buffer.
</p> </p>
<pre> <pre>
n, err := f.Read(buf[0:32]) n, err := f.Read(buf[0:32])
...@@ -1488,7 +1489,7 @@ If the slices might grow or shrink, they should be allocated independently ...@@ -1488,7 +1489,7 @@ If the slices might grow or shrink, they should be allocated independently
to avoid overwriting the next line; if not, it can be more efficient to construct to avoid overwriting the next line; if not, it can be more efficient to construct
the object with a single allocation. the object with a single allocation.
For reference, here are sketches of the two methods. For reference, here are sketches of the two methods.
First, a line a time: First, a line at a time:
</p> </p>
<pre> <pre>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment