File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -631,12 +631,10 @@ func sanitizeCollectionName(db string, coll string) string {
631
631
}
632
632
633
633
func (t * T ) createTestClient () {
634
- var clientOpts * options. ClientOptions
635
- if t . clientOpts == nil {
634
+ clientOpts := t . clientOpts
635
+ if clientOpts == nil {
636
636
// default opts
637
637
clientOpts = options .Client ().SetWriteConcern (MajorityWc ).SetReadPreference (PrimaryRp )
638
- } else {
639
- clientOpts = options .MergeClientOptions (t .clientOpts )
640
638
}
641
639
// set ServerAPIOptions to latest version if required
642
640
if clientOpts .Deployment == nil && t .clientType != Mock && clientOpts .ServerAPIOptions == nil && testContext .requireAPIVersion {
@@ -728,8 +726,9 @@ func (t *T) createTestClient() {
728
726
t .Fatalf ("error connecting client: %v" , err )
729
727
}
730
728
731
- clientOpts .AutoEncryptionOptions = nil
732
- t .fpClient , err = mongo .NewClient (uriOpts , clientOpts )
729
+ fpOpts := options .MergeClientOptions (uriOpts , clientOpts )
730
+ fpOpts .AutoEncryptionOptions = nil
731
+ t .fpClient , err = mongo .NewClient (fpOpts )
733
732
if err != nil {
734
733
t .Fatalf ("error creating client: %v" , err )
735
734
}
You can’t perform that action at this time.
0 commit comments