package synchelper import "bytes" // NewBytesBufferPool 返回新的 BytesBufferPool func NewBytesBufferPool(initialSize, maximumSize int) BytesBufferPool { return NewPool( func() any { return bytes.NewBuffer(make([]byte, 0, initialSize)) }, func(v *bytes.Buffer) bool { return v.Cap() <= maximumSize }, ) } // BytesBufferPool 是 [*bytes.Buffer] 的资源池 type BytesBufferPool = Pool[*bytes.Buffer]