linting
This commit is contained in:
@@ -45,7 +45,8 @@ func NewMongoTimeSeriesCollection(ctx context.Context, db *mongo.Database, tsOpt
|
||||
}
|
||||
|
||||
if err := db.CreateCollection(ctx, tsOpts.Collection, collOpts); err != nil {
|
||||
if cmdErr, ok := err.(mongo.CommandError); !ok || cmdErr.Code != 48 {
|
||||
var cmdErr mongo.CommandError
|
||||
if !errors.As(err, &cmdErr) || cmdErr.Code != 48 {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -86,7 +87,9 @@ func (ts *TimeSeries) executeQuery(ctx context.Context, decoder rdecoder.Decodin
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cursor.Close(ctx)
|
||||
defer func() {
|
||||
_ = cursor.Close(ctx)
|
||||
}()
|
||||
|
||||
for cursor.Next(ctx) {
|
||||
if err := cursor.Err(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user