From 0c8415699e0a790551b2f6964efac2569a997bfd Mon Sep 17 00:00:00 2001
From: Rob Pike
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
-b
, slice (here used as a verb) the buffer.
+any.
+To read into the first 32 bytes of a larger buffer
+buf
, slice (here used as a verb) the buffer.
n, err := f.Read(buf[0:32])
@@ -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
the object with a single allocation.
For reference, here are sketches of the two methods.
-First, a line a time:
+First, a line at a time:
-- 2.50.0