var bufferPool … type BufferPool … type defaultPool … func (p *defaultPool) Put(buf *bytes.Buffer) { … } func (p *defaultPool) Get() *bytes.Buffer { … } // SetBufferPool allows to replace the default logrus buffer pool // to better meets the specific needs of an application. func SetBufferPool(bp BufferPool) { … } func init() { … }