mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
16 lines
303 B
Go
16 lines
303 B
Go
package keelmongo
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/foomo/keel/log"
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
)
|
|
|
|
// CloseCursor with defer
|
|
func CloseCursor(ctx context.Context, cursor *mongo.Cursor) {
|
|
if err := cursor.Close(ctx); err != nil {
|
|
log.WithError(nil, err).Error("failed to close cursor")
|
|
}
|
|
}
|