mirror of
https://github.com/hanzoai/search-go.git
synced 2026-10-30 18:22:58 +00:00
* chore: update Go version to 1.20 and golangci-lint to v2.3.0 in Dockerfile and tests.yml * fix: update golangci action version to latest * chore: fix linter issues * chore: update Go version in pre-release and tests configuration to 1.20 * chore: update dependency management in tests.yml to use go.mod * chore: update dependency management in pre-release-tests.yml to use go.mod * chore: simplify dependency retrieval in CI configuration * chore: remove unnecessary flags in dependency retrieval for CI configurations * chore: update Go version format in CI configuration files
22 lines
285 B
Go
22 lines
285 B
Go
package meilisearch
|
|
|
|
import (
|
|
"bytes"
|
|
"sync"
|
|
)
|
|
|
|
type pooledBuffer struct {
|
|
*bytes.Buffer
|
|
pool *sync.Pool
|
|
}
|
|
|
|
func (pb *pooledBuffer) Read(p []byte) (int, error) {
|
|
return pb.Buffer.Read(p)
|
|
}
|
|
|
|
func (pb *pooledBuffer) Close() error {
|
|
pb.Reset()
|
|
pb.pool.Put(pb.Buffer)
|
|
return nil
|
|
}
|