Migration: go 1.18

This commit is contained in:
Dreamacro
2022-03-16 12:10:13 +08:00
parent d1dd21417b
commit 6a661bff0c
73 changed files with 705 additions and 307 deletions

View File

@ -71,12 +71,12 @@ func (pc *PoolConn) Close() error {
func NewPool(factory func(context.Context) (*Snell, error)) *Pool {
p := pool.New(
func(ctx context.Context) (interface{}, error) {
func(ctx context.Context) (any, error) {
return factory(ctx)
},
pool.WithAge(15000),
pool.WithSize(10),
pool.WithEvict(func(item interface{}) {
pool.WithEvict(func(item any) {
item.(*Snell).Close()
}),
)