Skip to content

Commit 7951779

Browse files
Mathieuskriptble
authored andcommitted
Validate clientOptions on client creation
1 parent bde4e56 commit 7951779

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mongo/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, erro
7676
func NewClient(opts ...*options.ClientOptions) (*Client, error) {
7777
clientOpt := options.MergeClientOptions(opts...)
7878

79+
err := clientOpt.Validate()
80+
if err != nil {
81+
return nil, err
82+
}
83+
7984
id, err := uuid.New()
8085
if err != nil {
8186
return nil, err

0 commit comments

Comments
 (0)