Use createCreateResourceFunc
This commit is contained in:
+1
-4
@@ -491,10 +491,7 @@ func TestPoolReturnClosesResourcePoolIsAlreadyClosedErrorIsReported(t *testing.T
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkPoolGetAndReturnNoContention(b *testing.B) {
|
func BenchmarkPoolGetAndReturnNoContention(b *testing.B) {
|
||||||
var createCalls Counter
|
createFunc, _ := createCreateResourceFunc()
|
||||||
createFunc := func() (interface{}, error) {
|
|
||||||
return createCalls.Next(), nil
|
|
||||||
}
|
|
||||||
pool := puddle.NewPool(createFunc, stubCloseRes)
|
pool := puddle.NewPool(createFunc, stubCloseRes)
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
|
|||||||
Reference in New Issue
Block a user