Skip to content

Commit

Permalink
chore: remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vareversat committed Jul 5, 2024
1 parent edfa162 commit e12395c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/repositories/forecast_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ func (fR *forecastRepository) DeleteAll(
) (int64, error) {
deleteResult, err := fR.collection.DeleteMany(ctx, bson.D{})

return deleteResult.DeletedCount, err

if deleteResult != nil {
return deleteResult.DeletedCount, nil
}
return 0, err
}

func (fR *forecastRepository) InsertAll(
Expand All @@ -218,8 +220,10 @@ func (fR *forecastRepository) InsertAll(
}
insertResult, err := fR.collection.InsertMany(ctx, interfaceRecords)

return len(insertResult.InsertedIDs), err

if insertResult != nil {
return len(insertResult.InsertedIDs), nil
}
return 0, err
}

func computeMongoCursor(
Expand Down

0 comments on commit e12395c

Please sign in to comment.