diff --git a/pool/pool.go b/pool/pool.go index 988ded2..afd1e07 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -3,11 +3,11 @@ package pool import "sync" type Pool[T any] struct { - p sync.Pool + p *sync.Pool } -func New[T any]() Pool[T] { - return Pool[T]{sync.Pool{New: func() any { return new(T) }}} +func New[T any]() *Pool[T] { + return &Pool[T]{&sync.Pool{New: func() any { return new(T) }}} } func (p *Pool[T]) Get() *T {