Skip to content

Commit 9b4900c

Browse files
committed
moved checking empty dsn to option implementation
1 parent 62f0f85 commit 9b4900c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

connection.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ func open(ctx context.Context, opts ...Option) (_ Connection, err error) {
253253
}
254254
}
255255
for _, opt := range opts {
256-
if opt == nil {
257-
continue
258-
}
259256
err = opt(ctx, c)
260257
if err != nil {
261258
return nil, xerrors.WithStackTrace(err)

options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ func WithRequestsType(requestsType string) Option {
6262
// Warning: WithConnectionString will be removed at next major release
6363
// (connection string will be required string param of ydb.Open)
6464
func WithConnectionString(connectionString string) Option {
65-
if connectionString == "" {
66-
return nil
67-
}
6865
return func(ctx context.Context, c *connection) error {
66+
if connectionString == "" {
67+
return nil
68+
}
6969
options, err := dsn.Parse(connectionString)
7070
if err != nil {
7171
return xerrors.WithStackTrace(

0 commit comments

Comments
 (0)