Files
log/entry/pool.go
andrey 1637fb5119
Some checks failed
Go Action / lint (push) Has been cancelled
Go Action / lint (pull_request) Has been cancelled
update lint
2025-12-23 20:59:06 +03:00

23 lines
251 B
Go

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