syncpool
The mkm.pub/syncpool
package provides a generic wrapper around the sync.Pool structure.
This package is just a thin wrapper around the underlying interface{}
based implementation in the stdlib.
It requires go1.18. If when you're reading this go1.18 is not released yet you can download 1.18beta or just try with the latest gotip.
Usage
go get mkm.pub/syncpool
p := syncpool.New(NewFoo)
var v Foo
v = p.Get()
// ...
p.Put(v)