Source File
buffer_pool.go
Belonging Package
github.com/sirupsen/logrus
package logrusimport ()var bufferPool BufferPool = &defaultPool{pool: &sync.Pool{New: func() any {return new(bytes.Buffer)},},}type BufferPool interface {Put(*bytes.Buffer)Get() *bytes.Buffer}type defaultPool struct {pool *sync.Pool}func ( *defaultPool) ( *bytes.Buffer) {.pool.Put()}func ( *defaultPool) () *bytes.Buffer {return .pool.Get().(*bytes.Buffer)}// SetBufferPool allows to replace the default logrus buffer pool// to better meet the specific needs of an application.func ( BufferPool) {bufferPool =}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |