Skip to content

Remove oppressive language from source code and documentation #717

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
merged 6 commits into from
Aug 18, 2021
Merged

Remove oppressive language from source code and documentation #717

merged 6 commits into from
Aug 18, 2021

Conversation

benjirewis
Copy link
Contributor

GODRIVER-2007
GODRIVER-2008

Removes most occurrences of oppressive language from source code, documentation, and tests.

Feel free to download GNU grep with brew install grep and use ggrep -PriI '(docs\.mongodb\.com\/master\|(?<!/)master(?!.?key)\|slave\|whitelist\|blacklist)' to check for any missed occurrences.

})
mt.Run("decode struct", func(mt *mtest.T) {
result := struct {
IsMaster bool `bson:"ismaster"`
Ok float64 `bson:"ok"`
Hello bool `bson:"ismaster"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you have any clever ways of obfuscating or removing this ismaster struct tag. Wasn't sure how to do it without altering the underlying test.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the intent of this test is to check that the mongo.SingleResult returned by RunCommand can be decoded into a struct. I do not think it is necessary to use the ismaster command to test this.

hello was backported to 3.6, but the Go driver tests back to 2.6.

Could we use the ping command? And change the result struct to contain only the Ok field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea; switched to ping and removed the Hello field entirely.

var LegacyHelloLowercase = "ismaster"

// LegacyNotPrimary is the legacy version of the "not primary" server error message.
var LegacyNotPrimary = "not master"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you think there's a better place for these constants.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a sensible place to me.

@benjirewis benjirewis marked this pull request as ready for review August 16, 2021 15:25
Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

var LegacyHelloLowercase = "ismaster"

// LegacyNotPrimary is the legacy version of the "not primary" server error message.
var LegacyNotPrimary = "not master"
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a sensible place to me.

})
mt.Run("decode struct", func(mt *mtest.T) {
result := struct {
IsMaster bool `bson:"ismaster"`
Ok float64 `bson:"ok"`
Hello bool `bson:"ismaster"`
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the intent of this test is to check that the mongo.SingleResult returned by RunCommand can be decoded into a struct. I do not think it is necessary to use the ismaster command to test this.

hello was backported to 3.6, but the Go driver tests back to 2.6.

Could we use the ping command? And change the result struct to contain only the Ok field.

@benjirewis benjirewis requested a review from kevinAlbs August 18, 2021 17:17
Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM!

@benjirewis benjirewis merged commit 6385557 into mongodb:master Aug 18, 2021
@benjirewis benjirewis deleted the oppLangRemoval.2007-2008 branch August 18, 2021 18:52
faem pushed a commit to kubedb/mongo-go-driver that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants