Commit a50225a0 authored by Joe Tsai's avatar Joe Tsai
Browse files

bufio: make Reader.Reset and Writer.Reset work on the zero value

For batch allocation reasons, it would be useful to nest a
bufio.Reader or bufio.Writer in a struct as a value,
rather than a pointer. When the Reset method is called,
have it use the default buffer size if the buffer is nil.

Fixes #45374

Change-Id: I80df18a13575431428a42ed150a1579de1282637
Reviewed-on: https://go-review.googlesource.com/c/go/+/345570


Trust: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent cf2fe5d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment