Skip to content

Commit

Permalink
GODRIVER-2810 Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvasquez committed Sep 7, 2023
1 parent 3672bb4 commit b8cba73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mongo/options/clientoptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,6 @@ func TestClientOptions(t *testing.T) {
t.Run("server monitoring mode validation", func(t *testing.T) {
t.Parallel()

// := fmt.Errorf("invalid server monitoring mode: %q", *mode)

testCases := []struct {
name string
opts *ClientOptions
Expand Down Expand Up @@ -801,6 +799,8 @@ func TestClientOptions(t *testing.T) {
tc := tc // Capture the range variable

t.Run(tc.name, func(t *testing.T) {
t.Parallel()

err := tc.opts.Validate()
assert.Equal(t, tc.err, err, "expected error %v, got %v", tc.err, err)
})
Expand Down
3 changes: 2 additions & 1 deletion x/mongo/driver/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,14 +1109,15 @@ func (op Operation) createLegacyHandshakeWireMessage(
dst []byte,
desc description.SelectedServer,
) ([]byte, startedInformation, error) {
var dollarCmd = [...]byte{'.', '$', 'c', 'm', 'd'}
var info startedInformation
flags := op.secondaryOK(desc)
var wmindex int32
info.requestID = wiremessage.NextRequestID()
wmindex, dst = wiremessage.AppendHeaderStart(dst, info.requestID, 0, wiremessage.OpQuery)
dst = wiremessage.AppendQueryFlags(dst, flags)

var dollarCmd = [...]byte{'.', '$', 'c', 'm', 'd'}

// FullCollectionName
dst = append(dst, op.Database...)
dst = append(dst, dollarCmd[:]...)
Expand Down
6 changes: 0 additions & 6 deletions x/mongo/driver/topology/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

/// Copyright (C) MongoDB, Inc. 2017-present.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

package topology

import (
Expand Down

0 comments on commit b8cba73

Please sign in to comment.