-
Notifications
You must be signed in to change notification settings - Fork 243
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
base: development
Are you sure you want to change the base?
Fixed linters & tests in Mongo, Solr, Badger datasources #1245
Conversation
pkg/gofr/datasource/solr/solr.go
Outdated
// client.Connect() | ||
func New(conf Config) *Client { | ||
// client.Connect(). | ||
func New(conf *Config) *Client { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Pull Request Template
Description:
Checklist:
goimport
andgolangci-lint
.Thank you for your contribution!