Files
log/entry/pool.go
andrey 9f8f38e43f
All checks were successful
Go Action / goaction (push) Successful in 19m15s
add lint action (#19)
Reviewed-on: #19
2025-12-23 22:01:14 +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)
}