Skip to content

Commit 2bc145d

Browse files
authored
GODRIVER-2156 Enable unparam linter. (#802)
1 parent 28b03a4 commit 2bc145d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+209
-229
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ linters:
2323
- typecheck
2424
- unused
2525
- unconvert
26-
# - unparam
26+
- unparam
2727
- varcheck
2828

2929
linters-settings:

benchmark/bson_document.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"go.mongodb.org/mongo-driver/x/bsonx"
1414
)
1515

16-
func bsonDocumentEncoding(ctx context.Context, tm TimerManager, iters int, source string) error {
16+
func bsonDocumentEncoding(tm TimerManager, iters int, source string) error {
1717
doc, err := loadSourceDocument(getProjectRoot(), perfDataDir, bsonDataDir, source)
1818
if err != nil {
1919
return err
@@ -34,7 +34,7 @@ func bsonDocumentEncoding(ctx context.Context, tm TimerManager, iters int, sourc
3434
return nil
3535
}
3636

37-
func bsonDocumentDecodingLazy(ctx context.Context, tm TimerManager, iters int, source string) error {
37+
func bsonDocumentDecodingLazy(tm TimerManager, iters int, source string) error {
3838
doc, err := loadSourceDocument(getProjectRoot(), perfDataDir, bsonDataDir, source)
3939
if err != nil {
4040
return err
@@ -59,7 +59,7 @@ func bsonDocumentDecodingLazy(ctx context.Context, tm TimerManager, iters int, s
5959
return nil
6060
}
6161

62-
func bsonDocumentDecoding(ctx context.Context, tm TimerManager, iters, numKeys int, source string) error {
62+
func bsonDocumentDecoding(tm TimerManager, iters, numKeys int, source string) error {
6363
doc, err := loadSourceDocument(getProjectRoot(), perfDataDir, bsonDataDir, source)
6464
if err != nil {
6565
return err
@@ -86,38 +86,38 @@ func bsonDocumentDecoding(ctx context.Context, tm TimerManager, iters, numKeys i
8686

8787
}
8888

89-
func BSONFlatDocumentEncoding(ctx context.Context, tm TimerManager, iters int) error {
90-
return bsonDocumentEncoding(ctx, tm, iters, flatBSONData)
89+
func BSONFlatDocumentEncoding(_ context.Context, tm TimerManager, iters int) error {
90+
return bsonDocumentEncoding(tm, iters, flatBSONData)
9191
}
9292

93-
func BSONFlatDocumentDecodingLazy(ctx context.Context, tm TimerManager, iters int) error {
94-
return bsonDocumentDecodingLazy(ctx, tm, iters, flatBSONData)
93+
func BSONFlatDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error {
94+
return bsonDocumentDecodingLazy(tm, iters, flatBSONData)
9595
}
9696

97-
func BSONFlatDocumentDecoding(ctx context.Context, tm TimerManager, iters int) error {
98-
return bsonDocumentDecoding(ctx, tm, iters, 145, flatBSONData)
97+
func BSONFlatDocumentDecoding(_ context.Context, tm TimerManager, iters int) error {
98+
return bsonDocumentDecoding(tm, iters, 145, flatBSONData)
9999
}
100100

101-
func BSONDeepDocumentEncoding(ctx context.Context, tm TimerManager, iters int) error {
102-
return bsonDocumentEncoding(ctx, tm, iters, deepBSONData)
101+
func BSONDeepDocumentEncoding(_ context.Context, tm TimerManager, iters int) error {
102+
return bsonDocumentEncoding(tm, iters, deepBSONData)
103103
}
104104

105-
func BSONDeepDocumentDecodingLazy(ctx context.Context, tm TimerManager, iters int) error {
106-
return bsonDocumentDecodingLazy(ctx, tm, iters, deepBSONData)
105+
func BSONDeepDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error {
106+
return bsonDocumentDecodingLazy(tm, iters, deepBSONData)
107107
}
108108

109-
func BSONDeepDocumentDecoding(ctx context.Context, tm TimerManager, iters int) error {
110-
return bsonDocumentDecoding(ctx, tm, iters, 126, deepBSONData)
109+
func BSONDeepDocumentDecoding(_ context.Context, tm TimerManager, iters int) error {
110+
return bsonDocumentDecoding(tm, iters, 126, deepBSONData)
111111
}
112112

113-
func BSONFullDocumentEncoding(ctx context.Context, tm TimerManager, iters int) error {
114-
return bsonDocumentEncoding(ctx, tm, iters, fullBSONData)
113+
func BSONFullDocumentEncoding(_ context.Context, tm TimerManager, iters int) error {
114+
return bsonDocumentEncoding(tm, iters, fullBSONData)
115115
}
116116

117-
func BSONFullDocumentDecodingLazy(ctx context.Context, tm TimerManager, iters int) error {
118-
return bsonDocumentDecodingLazy(ctx, tm, iters, fullBSONData)
117+
func BSONFullDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error {
118+
return bsonDocumentDecodingLazy(tm, iters, fullBSONData)
119119
}
120120

121-
func BSONFullDocumentDecoding(ctx context.Context, tm TimerManager, iters int) error {
122-
return bsonDocumentDecoding(ctx, tm, iters, 145, fullBSONData)
121+
func BSONFullDocumentDecoding(_ context.Context, tm TimerManager, iters int) error {
122+
return bsonDocumentDecoding(tm, iters, 145, fullBSONData)
123123
}

benchmark/bson_map.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"go.mongodb.org/mongo-driver/bson"
1515
)
1616

17-
func bsonMapDecoding(ctx context.Context, tm TimerManager, iters int, dataSet string) error {
17+
func bsonMapDecoding(tm TimerManager, iters int, dataSet string) error {
1818
r, err := loadSourceRaw(getProjectRoot(), perfDataDir, bsonDataDir, dataSet)
1919
if err != nil {
2020
return err
@@ -35,7 +35,7 @@ func bsonMapDecoding(ctx context.Context, tm TimerManager, iters int, dataSet st
3535
return nil
3636
}
3737

38-
func bsonMapEncoding(ctx context.Context, tm TimerManager, iters int, dataSet string) error {
38+
func bsonMapEncoding(tm TimerManager, iters int, dataSet string) error {
3939
r, err := loadSourceRaw(getProjectRoot(), perfDataDir, bsonDataDir, dataSet)
4040
if err != nil {
4141
return err
@@ -63,26 +63,26 @@ func bsonMapEncoding(ctx context.Context, tm TimerManager, iters int, dataSet st
6363
return nil
6464
}
6565

66-
func BSONFlatMapDecoding(ctx context.Context, tm TimerManager, iters int) error {
67-
return bsonMapDecoding(ctx, tm, iters, flatBSONData)
66+
func BSONFlatMapDecoding(_ context.Context, tm TimerManager, iters int) error {
67+
return bsonMapDecoding(tm, iters, flatBSONData)
6868
}
6969

70-
func BSONFlatMapEncoding(ctx context.Context, tm TimerManager, iters int) error {
71-
return bsonMapEncoding(ctx, tm, iters, flatBSONData)
70+
func BSONFlatMapEncoding(_ context.Context, tm TimerManager, iters int) error {
71+
return bsonMapEncoding(tm, iters, flatBSONData)
7272
}
7373

74-
func BSONDeepMapDecoding(ctx context.Context, tm TimerManager, iters int) error {
75-
return bsonMapDecoding(ctx, tm, iters, deepBSONData)
74+
func BSONDeepMapDecoding(_ context.Context, tm TimerManager, iters int) error {
75+
return bsonMapDecoding(tm, iters, deepBSONData)
7676
}
7777

78-
func BSONDeepMapEncoding(ctx context.Context, tm TimerManager, iters int) error {
79-
return bsonMapEncoding(ctx, tm, iters, deepBSONData)
78+
func BSONDeepMapEncoding(_ context.Context, tm TimerManager, iters int) error {
79+
return bsonMapEncoding(tm, iters, deepBSONData)
8080
}
8181

82-
func BSONFullMapDecoding(ctx context.Context, tm TimerManager, iters int) error {
83-
return bsonMapDecoding(ctx, tm, iters, fullBSONData)
82+
func BSONFullMapDecoding(_ context.Context, tm TimerManager, iters int) error {
83+
return bsonMapDecoding(tm, iters, fullBSONData)
8484
}
8585

86-
func BSONFullMapEncoding(ctx context.Context, tm TimerManager, iters int) error {
87-
return bsonMapEncoding(ctx, tm, iters, fullBSONData)
86+
func BSONFullMapEncoding(_ context.Context, tm TimerManager, iters int) error {
87+
return bsonMapEncoding(tm, iters, fullBSONData)
8888
}

bson/bsoncodec/cond_addr_codec_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ func TestCondAddrCodec(t *testing.T) {
2424

2525
t.Run("addressEncode", func(t *testing.T) {
2626
invoked := 0
27-
encode1 := func(EncodeContext, bsonrw.ValueWriter, reflect.Value) error {
27+
encode1 := ValueEncoderFunc(func(EncodeContext, bsonrw.ValueWriter, reflect.Value) error {
2828
invoked = 1
2929
return nil
30-
}
31-
encode2 := func(EncodeContext, bsonrw.ValueWriter, reflect.Value) error {
30+
})
31+
encode2 := ValueEncoderFunc(func(EncodeContext, bsonrw.ValueWriter, reflect.Value) error {
3232
invoked = 2
3333
return nil
34-
}
35-
condEncoder := newCondAddrEncoder(ValueEncoderFunc(encode1), ValueEncoderFunc(encode2))
34+
})
35+
condEncoder := newCondAddrEncoder(encode1, encode2)
3636

3737
testCases := []struct {
3838
name string
@@ -52,23 +52,23 @@ func TestCondAddrCodec(t *testing.T) {
5252
}
5353

5454
t.Run("error", func(t *testing.T) {
55-
errEncoder := newCondAddrEncoder(ValueEncoderFunc(encode1), nil)
55+
errEncoder := newCondAddrEncoder(encode1, nil)
5656
err := errEncoder.EncodeValue(EncodeContext{}, rw, unaddressable)
5757
want := ErrNoEncoder{Type: unaddressable.Type()}
5858
assert.Equal(t, err, want, "expected error %v, got %v", want, err)
5959
})
6060
})
6161
t.Run("addressDecode", func(t *testing.T) {
6262
invoked := 0
63-
decode1 := func(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
63+
decode1 := ValueDecoderFunc(func(DecodeContext, bsonrw.ValueReader, reflect.Value) error {
6464
invoked = 1
6565
return nil
66-
}
67-
decode2 := func(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
66+
})
67+
decode2 := ValueDecoderFunc(func(DecodeContext, bsonrw.ValueReader, reflect.Value) error {
6868
invoked = 2
6969
return nil
70-
}
71-
condDecoder := newCondAddrDecoder(ValueDecoderFunc(decode1), ValueDecoderFunc(decode2))
70+
})
71+
condDecoder := newCondAddrDecoder(decode1, decode2)
7272

7373
testCases := []struct {
7474
name string
@@ -88,7 +88,7 @@ func TestCondAddrCodec(t *testing.T) {
8888
}
8989

9090
t.Run("error", func(t *testing.T) {
91-
errDecoder := newCondAddrDecoder(ValueDecoderFunc(decode1), nil)
91+
errDecoder := newCondAddrDecoder(decode1, nil)
9292
err := errDecoder.DecodeValue(DecodeContext{}, rw, unaddressable)
9393
want := ErrNoDecoder{Type: unaddressable.Type()}
9494
assert.Equal(t, err, want, "expected error %v, got %v", want, err)

bson/bsoncodec/default_value_decoders_test.go

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,15 +3040,15 @@ func TestDefaultValueDecoders(t *testing.T) {
30403040
doc = appendArrayElement(doc, "e", bsoncore.AppendInt64Element(nil, "0", 101112))
30413041
doc = appendArrayElement(doc, "f", bsoncore.AppendDoubleElement(nil, "0", 3.14159))
30423042
doc = appendArrayElement(doc, "g", bsoncore.AppendStringElement(nil, "0", "Hello, world"))
3043-
doc = appendArrayElement(doc, "h", buildDocumentElement("0", bsoncore.AppendStringElement(nil, "foo", "bar")))
3043+
doc = appendArrayElement(doc, "h", bsoncore.BuildDocumentElement(nil, "0", bsoncore.AppendStringElement(nil, "foo", "bar")))
30443044
doc = appendArrayElement(doc, "i", bsoncore.AppendBinaryElement(nil, "0", 0x00, []byte{0x01, 0x02, 0x03}))
30453045
doc = appendArrayElement(doc, "k",
3046-
buildArrayElement("0",
3046+
appendArrayElement(nil, "0",
30473047
bsoncore.AppendStringElement(bsoncore.AppendStringElement(nil, "0", "baz"), "1", "qux")),
30483048
)
3049-
doc = appendArrayElement(doc, "l", buildDocumentElement("0", bsoncore.AppendStringElement(nil, "m", "foobar")))
3049+
doc = appendArrayElement(doc, "l", bsoncore.BuildDocumentElement(nil, "0", bsoncore.AppendStringElement(nil, "m", "foobar")))
30503050
doc = appendArrayElement(doc, "n",
3051-
buildArrayElement("0",
3051+
appendArrayElement(nil, "0",
30523052
bsoncore.AppendStringElement(bsoncore.AppendStringElement(nil, "0", "foo"), "1", "bar")),
30533053
)
30543054
doc = appendArrayElement(doc, "r",
@@ -3062,7 +3062,7 @@ func TestDefaultValueDecoders(t *testing.T) {
30623062
doc = bsoncore.AppendNullElement(doc, "t")
30633063
doc = bsoncore.AppendNullElement(doc, "w")
30643064
doc = appendArrayElement(doc, "x", nil)
3065-
doc = appendArrayElement(doc, "y", buildDocumentElement("0", nil))
3065+
doc = appendArrayElement(doc, "y", bsoncore.BuildDocumentElement(nil, "0", nil))
30663066
doc = appendArrayElement(doc, "z",
30673067
bsoncore.AppendDateTimeElement(
30683068
bsoncore.AppendDateTimeElement(
@@ -3103,15 +3103,14 @@ func TestDefaultValueDecoders(t *testing.T) {
31033103
)
31043104
doc = appendArrayElement(doc, "ak",
31053105
bsoncore.AppendNullElement(
3106-
buildArrayElement("0",
3106+
appendArrayElement(nil, "0",
31073107
bsoncore.AppendStringElement(bsoncore.AppendStringElement(nil, "0", "foo"), "1", "bar"),
31083108
),
31093109
"1",
31103110
),
31113111
)
31123112
doc = appendArrayElement(doc, "al",
3113-
buildDocumentElement(
3114-
"0",
3113+
bsoncore.BuildDocumentElement(nil, "0",
31153114
bsoncore.AppendDoubleElement(bsoncore.AppendStringElement(nil, "hello", "world"), "pi", 3.14159),
31163115
),
31173116
)
@@ -3779,10 +3778,6 @@ func buildArray(vals []byte) []byte {
37793778
return doc
37803779
}
37813780

3782-
func buildArrayElement(key string, vals []byte) []byte {
3783-
return appendArrayElement(nil, key, vals)
3784-
}
3785-
37863781
func appendArrayElement(dst []byte, key string, vals []byte) []byte {
37873782
aix, doc := bsoncore.AppendArrayElementStart(dst, key)
37883783
doc = append(doc, vals...)
@@ -3797,10 +3792,3 @@ func buildDocument(elems []byte) []byte {
37973792
doc, _ = bsoncore.AppendDocumentEnd(doc, idx)
37983793
return doc
37993794
}
3800-
3801-
func buildDocumentElement(key string, elems []byte) []byte {
3802-
idx, doc := bsoncore.AppendDocumentElementStart(nil, key)
3803-
doc = append(doc, elems...)
3804-
doc, _ = bsoncore.AppendDocumentEnd(doc, idx)
3805-
return doc
3806-
}

bson/bsoncodec/default_value_encoders_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,15 +1712,15 @@ func TestDefaultValueEncoders(t *testing.T) {
17121712
doc = appendArrayElement(doc, "e", bsoncore.AppendInt64Element(nil, "0", 101112))
17131713
doc = appendArrayElement(doc, "f", bsoncore.AppendDoubleElement(nil, "0", 3.14159))
17141714
doc = appendArrayElement(doc, "g", bsoncore.AppendStringElement(nil, "0", "Hello, world"))
1715-
doc = appendArrayElement(doc, "h", buildDocumentElement("0", bsoncore.AppendStringElement(nil, "foo", "bar")))
1715+
doc = appendArrayElement(doc, "h", bsoncore.BuildDocumentElement(nil, "0", bsoncore.AppendStringElement(nil, "foo", "bar")))
17161716
doc = appendArrayElement(doc, "i", bsoncore.AppendBinaryElement(nil, "0", 0x00, []byte{0x01, 0x02, 0x03}))
17171717
doc = appendArrayElement(doc, "k",
1718-
buildArrayElement("0",
1718+
appendArrayElement(nil, "0",
17191719
bsoncore.AppendStringElement(bsoncore.AppendStringElement(nil, "0", "baz"), "1", "qux")),
17201720
)
1721-
doc = appendArrayElement(doc, "l", buildDocumentElement("0", bsoncore.AppendStringElement(nil, "m", "foobar")))
1721+
doc = appendArrayElement(doc, "l", bsoncore.BuildDocumentElement(nil, "0", bsoncore.AppendStringElement(nil, "m", "foobar")))
17221722
doc = appendArrayElement(doc, "n",
1723-
buildArrayElement("0",
1723+
appendArrayElement(nil, "0",
17241724
bsoncore.AppendStringElement(bsoncore.AppendStringElement(nil, "0", "foo"), "1", "bar")),
17251725
)
17261726
doc = appendArrayElement(doc, "r",
@@ -1734,7 +1734,7 @@ func TestDefaultValueEncoders(t *testing.T) {
17341734
doc = bsoncore.AppendNullElement(doc, "t")
17351735
doc = bsoncore.AppendNullElement(doc, "w")
17361736
doc = appendArrayElement(doc, "x", nil)
1737-
doc = appendArrayElement(doc, "y", buildDocumentElement("0", nil))
1737+
doc = appendArrayElement(doc, "y", bsoncore.BuildDocumentElement(nil, "0", nil))
17381738
doc = appendArrayElement(doc, "z",
17391739
bsoncore.AppendDateTimeElement(
17401740
bsoncore.AppendDateTimeElement(

mongo/change_stream.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (cs *ChangeStream) executeOperation(ctx context.Context, resuming bool) err
212212
cs.aggregate.Deployment(cs.createOperationDeployment(server, conn))
213213

214214
if resuming {
215-
cs.replaceOptions(ctx, cs.wireVersion)
215+
cs.replaceOptions(cs.wireVersion)
216216

217217
csOptDoc := cs.createPipelineOptionsDoc()
218218
pipIdx, pipDoc := bsoncore.AppendDocumentStart(nil)
@@ -408,7 +408,7 @@ func (cs *ChangeStream) pipelineToBSON() (bsoncore.Document, error) {
408408
return pipelineArr, cs.err
409409
}
410410

411-
func (cs *ChangeStream) replaceOptions(ctx context.Context, wireVersion *description.VersionRange) {
411+
func (cs *ChangeStream) replaceOptions(wireVersion *description.VersionRange) {
412412
// Cached resume token: use the resume token as the resumeAfter option and set no other resume options
413413
if cs.resumeToken != nil {
414414
cs.options.SetResumeAfter(cs.resumeToken)

mongo/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func TestClient(t *testing.T) {
307307

308308
serverVersion, err := getServerVersion(client.Database("admin"))
309309
assert.Nil(t, err, "getServerVersion error: %v", err)
310-
if compareVersions(t, serverVersion, "3.6.0") < 1 {
310+
if compareVersions(serverVersion, "3.6.0") < 1 {
311311
t.Skip("skipping server version < 3.6")
312312
}
313313

mongo/integration/change_stream_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ func TestChangeStream_ReplicaSet(t *testing.T) {
488488
for i := 0; i < 2; i++ {
489489
assert.False(mt, cs.TryNext(mtest.Background), "TryNext returned true on iteration %v", i)
490490
}
491-
verifyOneGetmoreSent(mt, cs)
491+
verifyOneGetmoreSent(mt)
492492
})
493493
mt.RunOpts("getMore error", mtest.NewOptions().ClientType(mtest.Mock), func(mt *mtest.T) {
494494
// If the getMore attempt errors with a non-resumable error, TryNext returns false

mongo/integration/collection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ func TestCollection(t *testing.T) {
773773
testAggregateWithOptions(mt, true, options.Aggregate().SetHint(hint))
774774
})
775775
mt.RunOpts("multikey map hint", mtest.NewOptions().MinServerVersion("3.6"), func(mt *mtest.T) {
776-
pipeline := mongo.Pipeline{{{"$out", mt.Coll.Name()}}}
776+
pipeline := mongo.Pipeline{bson.D{{"$out", mt.Coll.Name()}}}
777777
cursor, err := mt.Coll.Aggregate(mtest.Background, pipeline, options.Aggregate().SetHint(bson.M{"x": 1, "y": 1}))
778778
assert.Nil(mt, cursor, "expected cursor nil, got %v", cursor)
779779
assert.Equal(mt, mongo.ErrMapForOrderedArgument{"hint"}, err, "expected error %v, got %v", mongo.ErrMapForOrderedArgument{"hint"}, err)

mongo/integration/crud_helpers_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func killSessions(mt *mtest.T) {
104104

105105
// killAllSessions has to be run against each mongos in a sharded cluster, so we use the runCommandOnAllServers
106106
// helper.
107-
err := runCommandOnAllServers(mt, func(client *mongo.Client) error {
107+
err := runCommandOnAllServers(func(client *mongo.Client) error {
108108
return client.Database("admin").RunCommand(mtest.Background, cmd, runCmdOpts).Err()
109109
})
110110

@@ -118,7 +118,7 @@ func killSessions(mt *mtest.T) {
118118

119119
// Utility function to run a command on all servers. For standalones, the command is run against the one server. For
120120
// replica sets, the command is run against the primary. sharded clusters, the command is run against each mongos.
121-
func runCommandOnAllServers(mt *mtest.T, commandFn func(client *mongo.Client) error) error {
121+
func runCommandOnAllServers(commandFn func(client *mongo.Client) error) error {
122122
opts := options.Client().ApplyURI(mtest.ClusterURI())
123123
testutil.AddTestServerAPIVersion(opts)
124124

@@ -337,7 +337,7 @@ func executeInsertMany(mt *mtest.T, sess mongo.Session, args bson.Raw) (*mongo.I
337337
return mt.Coll.InsertMany(mtest.Background, docs, opts)
338338
}
339339

340-
func setFindModifiers(mt *mtest.T, modifiersDoc bson.Raw, opts *options.FindOptions) {
340+
func setFindModifiers(modifiersDoc bson.Raw, opts *options.FindOptions) {
341341
elems, _ := modifiersDoc.Elements()
342342
for _, elem := range elems {
343343
key := elem.Key()
@@ -387,7 +387,7 @@ func executeFind(mt *mtest.T, sess mongo.Session, args bson.Raw) (*mongo.Cursor,
387387
case "collation":
388388
opts = opts.SetCollation(createCollation(mt, val.Document()))
389389
case "modifiers":
390-
setFindModifiers(mt, val.Document(), opts)
390+
setFindModifiers(val.Document(), opts)
391391
case "allowDiskUse":
392392
opts = opts.SetAllowDiskUse(val.Boolean())
393393
case "projection":

0 commit comments

Comments
 (0)