Files
log/entry/pool.go
andrey b56ca08811 update zap/logrus hanler (#1)
Co-authored-by: andrey1s <andrey_simfi@list.ru>
Reviewed-on: #1
Co-authored-by: andrey <andrey@4devs.io>
Co-committed-by: andrey <andrey@4devs.io>
2022-01-02 14:32:19 +03:00

23 lines
262 B
Go

package entry
import "sync"
// nolint: gochecknoglobals
var pool = sync.Pool{
New: func() interface{} {
return New()
},
}
//nolint: forcetypeassert
func Get() *Entry {
e := pool.Get().(*Entry)
e.Reset()
return e
}
func Put(e *Entry) {
pool.Put(e)
}