(ctx context.Context)
| 381 | } |
| 382 | |
| 383 | func (c *baseClient) getConn(ctx context.Context) (*pool.Conn, error) { |
| 384 | if c.opt.Limiter != nil { |
| 385 | err := c.opt.Limiter.Allow() |
| 386 | if err != nil { |
| 387 | return nil, err |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | cn, err := c._getConn(ctx) |
| 392 | if err != nil { |
| 393 | if c.opt.Limiter != nil { |
| 394 | c.opt.Limiter.ReportResult(err) |
| 395 | } |
| 396 | return nil, err |
| 397 | } |
| 398 | |
| 399 | return cn, nil |
| 400 | } |
| 401 | |
| 402 | func (c *baseClient) _getConn(ctx context.Context) (*pool.Conn, error) { |
| 403 | cn, err := c.connPool.Get(ctx) |
no test coverage detected