Skip to content

Commit 876b974

Browse files
Bump go.mongodb.org/mongo-driver/v2 from v2.2.0 to v2.2.1 (#99)
1 parent 3543b57 commit 876b974

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

aggregator/aggregator.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ func (a *Aggregator[T]) Aggregate(ctx context.Context, opts ...options.Lister[op
8787
if err != nil {
8888
return nil, err
8989
}
90-
defer cursor.Close(ctx)
90+
defer func(cursor *mongo.Cursor, ctx context.Context) {
91+
_ = cursor.Close(ctx)
92+
}(cursor, ctx)
9193

9294
result := make([]*T, 0)
9395
err = cursor.All(ctx, &result)
@@ -122,7 +124,9 @@ func (a *Aggregator[T]) AggregateWithParse(ctx context.Context, result any, opts
122124
if err != nil {
123125
return err
124126
}
125-
defer cursor.Close(ctx)
127+
defer func(cursor *mongo.Cursor, ctx context.Context) {
128+
_ = cursor.Close(ctx)
129+
}(cursor, ctx)
126130
err = cursor.All(ctx, result)
127131
if err != nil {
128132
return err

finder/finder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ func (f *Finder[T]) Find(ctx context.Context, opts ...options.Lister[options.Fin
207207
if err != nil {
208208
return nil, err
209209
}
210-
defer cursor.Close(ctx)
210+
defer func(cursor *mongo.Cursor, ctx context.Context) {
211+
_ = cursor.Close(ctx)
212+
}(cursor, ctx)
211213
err = cursor.All(ctx, &t)
212214
if err != nil {
213215
return nil, err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/stretchr/testify v1.10.0
7-
go.mongodb.org/mongo-driver/v2 v2.2.0
7+
go.mongodb.org/mongo-driver/v2 v2.2.1
88
go.uber.org/mock v0.4.0
99
)
1010

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi
1818
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
1919
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
2020
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
21-
go.mongodb.org/mongo-driver/v2 v2.2.0 h1:WwhNgGrijwU56ps9RtIsgKfGLEZeypxqbEYfThrBScM=
22-
go.mongodb.org/mongo-driver/v2 v2.2.0/go.mod h1:qQkDMhCGWl3FN509DfdPd4GRBLU/41zqF/k8eTRceps=
21+
go.mongodb.org/mongo-driver/v2 v2.2.1 h1:w5xra3yyu/sGrziMzK1D0cRRaH/b7lWCSsoN6+WV6AM=
22+
go.mongodb.org/mongo-driver/v2 v2.2.1/go.mod h1:qQkDMhCGWl3FN509DfdPd4GRBLU/41zqF/k8eTRceps=
2323
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
2424
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
2525
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

0 commit comments

Comments
 (0)