Registry /
utility / jolestar-go-commons-pool-v2
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pool
✓ github.com/jolestar/go-commons-pool/v2
Creates an object pool, borrows and returns an object.
package main
import (
"fmt"
"github.com/jolestar/go-commons-pool/v2"
)
func main() {
factory := pool.NewPooledObjectFactorySimple(
func() (interface{}, error) { return "object", nil },
)
p := pool.NewObjectPoolWithDefaultConfig(factory)
obj, _ := p.BorrowObject()
fmt.Println(obj.(string))
p.ReturnObject(obj)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.1.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.