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