context returns the context for the current connection. If the context timeout is enabled, it returns the original context. Otherwise, it returns a new background context.
(ctx context.Context)
| 1031 | // If the context timeout is enabled, it returns the original context. |
| 1032 | // Otherwise, it returns a new background context. |
| 1033 | func (c *baseClient) context(ctx context.Context) context.Context { |
| 1034 | if c.opt.ContextTimeoutEnabled { |
| 1035 | return ctx |
| 1036 | } |
| 1037 | return context.Background() |
| 1038 | } |
| 1039 | |
| 1040 | // createInitConnFunc creates a connection initialization function that can be used for reconnections. |
| 1041 | func (c *baseClient) createInitConnFunc() func(context.Context, *pool.Conn) error { |
no outgoing calls
no test coverage detected