From d440d655ee4fe5c4b8a209d20fb04f9c7f30da84 Mon Sep 17 00:00:00 2001 From: MarkDaveny Date: Mon, 29 Apr 2024 20:37:18 +0800 Subject: [PATCH] chore: fix some comments and typos Signed-off-by: MarkDaveny --- etc/compile_check.sh | 2 +- mongo/options/mongooptions.go | 2 +- mongo/writeconcern/writeconcern.go | 2 +- x/mongo/driver/auth/speculative_x509_test.go | 2 +- x/mongo/driver/operation.go | 2 +- x/mongo/driver/operation_test.go | 2 +- x/mongo/driver/topology/polling_srv_records_test.go | 2 +- x/mongo/driver/wiremessage/wiremessage.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/compile_check.sh b/etc/compile_check.sh index 397322f2bf..cdb1dc4a66 100755 --- a/etc/compile_check.sh +++ b/etc/compile_check.sh @@ -12,7 +12,7 @@ function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } -# compile_check will attempt to build the the internal/test/compilecheck project +# compile_check will attempt to build the internal/test/compilecheck project # using the provided Go version. This is to simulate an end-to-end use case. # This check will only run on environments where the Go version is greater than # or equal to the given version. diff --git a/mongo/options/mongooptions.go b/mongo/options/mongooptions.go index fd17ce44e1..36088c2fcb 100644 --- a/mongo/options/mongooptions.go +++ b/mongo/options/mongooptions.go @@ -104,7 +104,7 @@ const ( // UpdateLookup includes a delta describing the changes to the document and a copy of the entire document that // was changed. UpdateLookup FullDocument = "updateLookup" - // WhenAvailable includes a post-image of the the modified document for replace and update change events + // WhenAvailable includes a post-image of the modified document for replace and update change events // if the post-image for this event is available. WhenAvailable FullDocument = "whenAvailable" ) diff --git a/mongo/writeconcern/writeconcern.go b/mongo/writeconcern/writeconcern.go index 1d9472ec0b..7a73d8d72f 100644 --- a/mongo/writeconcern/writeconcern.go +++ b/mongo/writeconcern/writeconcern.go @@ -51,7 +51,7 @@ var ErrNegativeWTimeout = errors.New("write concern `wtimeout` field cannot be n type WriteConcern struct { // W requests acknowledgment that the write operation has propagated to a // specified number of mongod instances or to mongod instances with - // specified tags. It sets the the "w" option in a MongoDB write concern. + // specified tags. It sets the "w" option in a MongoDB write concern. // // W values must be a string or an int. // diff --git a/x/mongo/driver/auth/speculative_x509_test.go b/x/mongo/driver/auth/speculative_x509_test.go index cf46de6ffd..85bd93191b 100644 --- a/x/mongo/driver/auth/speculative_x509_test.go +++ b/x/mongo/driver/auth/speculative_x509_test.go @@ -125,7 +125,7 @@ func createSpeculativeX509Handshake() []bsoncore.Document { return []bsoncore.Document{hello} } -// createSpeculativeX509Handshake creates the server replies for a handshake + X509 authentication attempt. +// createRegularX509Handshake creates the server replies for a handshake + X509 authentication attempt. // There are two replies: // // 1. hello reply diff --git a/x/mongo/driver/operation.go b/x/mongo/driver/operation.go index f30219d3d8..b557002293 100644 --- a/x/mongo/driver/operation.go +++ b/x/mongo/driver/operation.go @@ -622,7 +622,7 @@ func (op Operation) Execute(ctx context.Context) error { } }() for { - // If we're starting a retry and the the error from the previous try was + // If we're starting a retry and the error from the previous try was // a context canceled or deadline exceeded error, stop retrying and // return that error. if errors.Is(prevErr, context.Canceled) || errors.Is(prevErr, context.DeadlineExceeded) { diff --git a/x/mongo/driver/operation_test.go b/x/mongo/driver/operation_test.go index 4fcb58b72d..6445c9d0f6 100644 --- a/x/mongo/driver/operation_test.go +++ b/x/mongo/driver/operation_test.go @@ -80,7 +80,7 @@ func TestOperation(t *testing.T) { _, err := op.selectServer(context.Background(), 1, nil) noerr(t, err) - // Assert the the selector is an operation selector wrapper. + // Assert the selector is an operation selector wrapper. oss, ok := d.params.selector.(*opServerSelector) require.True(t, ok) diff --git a/x/mongo/driver/topology/polling_srv_records_test.go b/x/mongo/driver/topology/polling_srv_records_test.go index 7484109d4e..04f5e8c75b 100644 --- a/x/mongo/driver/topology/polling_srv_records_test.go +++ b/x/mongo/driver/topology/polling_srv_records_test.go @@ -313,7 +313,7 @@ func TestPollingSRVRecordsLoadBalanced(t *testing.T) { func TestPollSRVRecordsMaxHosts(t *testing.T) { // simulateSRVPoll creates a topology with srvMaxHosts, mocks the DNS changes described by - // recordsToAdd and recordsToRemove, and returns the the topology. + // recordsToAdd and recordsToRemove, and returns the topology. simulateSRVPoll := func(srvMaxHosts int, recordsToAdd []*net.SRV, recordsToRemove []*net.SRV) (*Topology, func(ctx context.Context) error) { t.Helper() diff --git a/x/mongo/driver/wiremessage/wiremessage.go b/x/mongo/driver/wiremessage/wiremessage.go index abf09c15bd..a13dda4e89 100644 --- a/x/mongo/driver/wiremessage/wiremessage.go +++ b/x/mongo/driver/wiremessage/wiremessage.go @@ -486,7 +486,7 @@ func ReadReplyCursorID(src []byte) (cursorID int64, rem []byte, ok bool) { return readi64(src) } -// ReadReplyStartingFrom reads the starting from from src. +// ReadReplyStartingFrom reads the starting from src. func ReadReplyStartingFrom(src []byte) (startingFrom int32, rem []byte, ok bool) { return readi32(src) }