fixup lint
Some checks failed
coverage / build (pull_request) Failing after 1m58s
lint / lint (pull_request) Successful in 3m31s
test / test (pull_request) Successful in 4m52s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-05-01 18:59:01 +03:00
parent 4e10570fb5
commit f1c323d991
3 changed files with 7 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ type wrapperConn struct {
conn driver.Conn conn driver.Conn
opts Options opts Options
ctx context.Context ctx context.Context
span tracer.Span //span tracer.Span
} }
// Close implements driver.Conn Close // Close implements driver.Conn Close
@@ -324,7 +324,7 @@ func (w *wrapperConn) Ping(ctx context.Context) error {
return pc.Close() return pc.Close()
} }
var nctx context.Context var nctx context.Context //nolint: gosimple
nctx = ctx nctx = ctx
/* /*
var span tracer.Span var span tracer.Span

View File

@@ -11,6 +11,7 @@ var (
// _ driver.Connector = (*wrapperDriver)(nil) // _ driver.Connector = (*wrapperDriver)(nil)
) )
/*
type conn interface { type conn interface {
driver.Pinger driver.Pinger
driver.Execer driver.Execer
@@ -21,6 +22,7 @@ type conn interface {
driver.ConnPrepareContext driver.ConnPrepareContext
driver.ConnBeginTx driver.ConnBeginTx
} }
*/
// wrapperDriver defines a wrapper for driver.Driver // wrapperDriver defines a wrapper for driver.Driver
type wrapperDriver struct { type wrapperDriver struct {
@@ -36,7 +38,7 @@ func NewWrapper(d driver.Driver, opts ...Option) driver.Driver {
type wrappedConnector struct { type wrappedConnector struct {
connector driver.Connector connector driver.Connector
name string // name string
opts Options opts Options
ctx context.Context ctx context.Context
} }

View File

@@ -4,12 +4,14 @@ import (
"database/sql/driver" "database/sql/driver"
) )
/*
func wrapDriver(d driver.Driver, opts Options) driver.Driver { func wrapDriver(d driver.Driver, opts Options) driver.Driver {
if _, ok := d.(driver.DriverContext); ok { if _, ok := d.(driver.DriverContext); ok {
return &wrapperDriver{driver: d, opts: opts} return &wrapperDriver{driver: d, opts: opts}
} }
return struct{ driver.Driver }{&wrapperDriver{driver: d, opts: opts}} return struct{ driver.Driver }{&wrapperDriver{driver: d, opts: opts}}
} }
*/
// WrapConn allows an existing driver.Conn to be wrapped. // WrapConn allows an existing driver.Conn to be wrapped.
func WrapConn(c driver.Conn, opts ...Option) driver.Conn { func WrapConn(c driver.Conn, opts ...Option) driver.Conn {