20 lines
276 B
Go
20 lines
276 B
Go
package pool
|
|
|
|
type Pool[T any] interface {
|
|
Get() T
|
|
Put(T)
|
|
}
|
|
|
|
type WithPutError[T any] interface {
|
|
Get() T
|
|
Put(T) error
|
|
}
|
|
|
|
type BufferFactoryInterfaceCompat struct {
|
|
BufferFactory
|
|
}
|
|
|
|
func (b BufferFactoryInterfaceCompat) Put(buf *Buffer) {
|
|
_ = b.BufferFactory.Put(buf)
|
|
}
|