Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed linters & tests in Mongo, Solr, Badger datasources #1245

Open
wants to merge 10 commits into
base: development
Choose a base branch
from

Conversation

coolwednesday
Copy link
Contributor

@coolwednesday coolwednesday commented Nov 27, 2024

Pull Request Template

Description:

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

pkg/gofr/datasource/mongo/mongo.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/solr/solr.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/solr/solr_test.go Show resolved Hide resolved
vikash
vikash previously approved these changes Nov 27, 2024
// client.Connect()
func New(conf Config) *Client {
// client.Connect().
func New(conf *Config) *Client {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unnecessary and does not feel like a good idea. Config should not be a pointer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

#1245 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to be consistent across all the datasources. Some datasources that have a heavy config struct are passed by reference. So was being consistent across datasources passing each config struct by reference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same point has been raised by myself, on another PR

#1254 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what should be done. I agree it's better to have a consistent say to do.

But having a pointer for a configuration looks strange, not, yes it has performance/memory issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants