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