Skip to content
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

GODRIVER-3452 MergeClientOptions returns object when given nil arguments #1917

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

prestonvasquez
Copy link
Collaborator

GODRIVER-3452

Summary

Currently MergeClientOptions returns nil when given a single nil argument. This is unexpected behavior, this function should always return an object to avoid a check where used.

Background & Motivation

NA

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jan 9, 2025
Copy link
Contributor

API Change Report

No changes found!

@prestonvasquez prestonvasquez requested review from qingyang-hu and removed request for matthewdale January 14, 2025 16:09
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)
})
Copy link
Collaborator

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?

Copy link
Collaborator

@qingyang-hu qingyang-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@prestonvasquez prestonvasquez merged commit ab61be4 into mongodb:master Jan 15, 2025
31 of 35 checks passed
@prestonvasquez prestonvasquez deleted the GODRIVER-3452 branch January 15, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants