(bufCap int64)
| 45 | } |
| 46 | |
| 47 | func newbufferPool(bufCap int64) *bufferPool { |
| 48 | pool := &sync.Pool{ |
| 49 | New: func() any { |
| 50 | return bytes.NewBuffer(make([]byte, 0, bufCap)) |
| 51 | }, |
| 52 | } |
| 53 | return &bufferPool{ |
| 54 | pool: pool, |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func (p *bufferPool) Get() *bytes.Buffer { |
| 59 | buf := p.pool.Get().(*bytes.Buffer) |
no outgoing calls
no test coverage detected
searching dependent graphs…