When I run the following code
func writeBytes() ([]byte, error) {
var buf bytes.Buffer
dstBytes := bufio.NewWriter(&buf)
writeTonsOfBytes(dstBytes)
b := buf.Bytes()
fmt.Println(len(b))
return b, nil
}
I get the output
32768
Which is signaling to me that there must be a limit on my bytes.Buffer
instance, which I can't find documentation for.
How can I write an unlimited number of bytes to a bytes.Buffer
?