Files
log/entry/pool.go
andrey 81eaf8c8b2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
update opentelemetry version (#6)
Co-authored-by: andrey1s <andrey@4devs.pro>
Reviewed-on: #6
Co-authored-by: andrey <andrey@4devs.io>
Co-committed-by: andrey <andrey@4devs.io>
2022-09-06 22:25:04 +03:00

23 lines
259 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)
}