-
Notifications
You must be signed in to change notification settings - Fork 372
Update to golangci-lint v2 #816
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
base: master
Are you sure you want to change the base?
Conversation
| docType := docValue.Type() | ||
| docKind := docType.Kind() | ||
| if docKind == reflect.Map { | ||
| switch docKind { |
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.
Does the linter require switch statement instead of if else block? I feel both style should be valid.
| if err != nil { | ||
| var commandErr mongo.CommandError | ||
| if !(errors.As(err, &commandErr) && commandErr.Code == 26) { | ||
| if !errors.As(err, &commandErr) || commandErr.Code != 26 { |
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.
Does the linter require always use one style of boolean logic? I feel either way should be fine but would not mind enforcing this from now on.
| imp.InputOptions.UseArrayIndexFields, | ||
| ), nil | ||
| } | ||
| return NewJSONInputReader( |
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.
nit since it is not related to linter change, I feel this should be in the else statement to be more readable.
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.
LGTM. Thanks for doing this work to make our code base quality better!
I have a few questions, it would be great if you can answer them.
Could you please also summarize the lint rule change in the PR DESCRIPTION? I got some idea by reviewing but think it would be nice to have it for reference.
This includes code updates to satisfy the new (more stringent) linter rules.