-
Notifications
You must be signed in to change notification settings - Fork 905
GODRIVER-3452 MergeClientOptions returns object when given nil arguments #1917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
API Change ReportNo changes found! |
qingyang-hu
reviewed
Jan 14, 2025
mongo/options/clientoptions_test.go
Outdated
Comment on lines
179
to
187
t.Run("MergeClientOptions single nil option", func(t *testing.T) { | ||
got := MergeClientOptions(nil) | ||
assert.NotNil(t, got) | ||
}) | ||
|
||
t.Run("MergeClientOptions multiple nil options", func(t *testing.T) { | ||
got := MergeClientOptions(nil, nil) | ||
assert.NotNil(t, got) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert the initialization of got
for better coverage instead of merely a NotNil?
qingyang-hu
approved these changes
Jan 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
drivers-pr-bot please backport to release/2.0 |
matthewdale
pushed a commit
to matthewdale/mongo-go-driver
that referenced
this pull request
Feb 19, 2025
matthewdale
added a commit
that referenced
this pull request
Feb 19, 2025
…ents (#1917) [release/2.0] (#1948) Co-authored-by: Preston Vasquez <[email protected]>
alcaeus
added a commit
that referenced
this pull request
Mar 4, 2025
* release/2.0: BUMP v2.0.1 GODRIVER-3477 Bump golang.org/x/crypto from 0.29.0 to 0.31.0 [release/2.0] (#1952) GODRIVER-3284 Allow valid SRV hostnames with less than 3 parts. (#1898) [release/2.0] (#1949) GODRIVER-3452 MergeClientOptions returns object when given nil arguments (#1917) [release/2.0] (#1948) GODRIVER-3443 Remove internal APIs in migration guide. (#1911) [release/2.0] (#1951) GODRIVER-3470 Correct BSON unmarshaling logic for null values (#1924) [master] (#1945) [release/2.0] (#1947) Fix erroneous nil error return in FindOne. (#1926) [release/2.0] (#1944) GODRIVER-3298 Handle joined errors correctly in WithTransaction. (#1928) [release/2.0] (#1931) GODRIVER-3307 clone returned byte slice in MarshalValue (#1913) [release/2.0] (#1921)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GODRIVER-3452
Summary
Currently MergeClientOptions returns
nil
when given a singlenil
argument. This is unexpected behavior, this function should always return an object to avoid a check where used.Background & Motivation
NA