Trying to allocate an in-memory buff of small size (few bytes) using
bytes.NewBuffer(make([]byte, 0, ))
The allocated buffer has size 4096 bytes i.e. > than what I requested for.
Why is this so?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
Probably I was doing something wrong. @Brian your snippet works as I would
have expected.
On Friday, 12 June 2020 15:43:14 UTC+5:30, Brian Candler wrote:
>
> However, it does say "The new Buffer takes ownership of buf" - why would
> it do that if it were allocating a new buffer and taking a copy