You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
What did you expect to see?
Because there is no New function supplied for bufioWriter2kPool and bufioWriter4kPool, every time pool Get return nil.
`
func newBufioWriterSize(w io.Writer, size int) *bufio.Writer {
pool := bufioWriterPool(size) // should delete or supply New func
if pool != nil {
if v := pool.Get(); v != nil {
bw := v.(*bufio.Writer)
bw.Reset(w)
return bw
}
}
return bufio.NewWriterSize(w, size)
}
`
What did you see instead?
The text was updated successfully, but these errors were encountered:
@wangsong93 the buffer pools are lazily initialised by filling the pool with entries in putBufioWriter rather than using a New function. This is because the bufio.Writer's returned from the pool must be a specific size which is best handled in newBufioWriterSize
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Because there is no New function supplied for bufioWriter2kPool and bufioWriter4kPool, every time pool Get return nil.
`
func newBufioWriterSize(w io.Writer, size int) *bufio.Writer {
}
`
What did you see instead?
The text was updated successfully, but these errors were encountered: