Add a generic sync.Pool wrapper to go library

Since we dropped support of Go 1.18-, use generic to avoid dealing with
type assertions with interface{}/any.

While I'm here, also remove the usages of ioutil, as that's officially
marked as deprecated in Go 1.19.

Client: go
11 files changed