-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[pkg/ottl] Fix gocritic complaints #14623
Conversation
switch ctx.GetDataPoint().(type) { | ||
case pmetric.NumberDataPoint: | ||
return ctx.GetDataPoint().(pmetric.NumberDataPoint).DoubleValue() | ||
numberDataPoint, ok := ctx.GetDataPoint().(pmetric.NumberDataPoint) |
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.
numberDataPoint, ok := ctx.GetDataPoint().(pmetric.NumberDataPoint) | |
if numberDataPoint, ok := ctx.GetDataPoint().(pmetric.NumberDataPoint); ok { |
I think keeping the assignment in the if
statement would be a bit more succinct.
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.
Youre right. I should stop multitasking
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 do think it is more succinct but harder to read. It is much easier to follow the code without having to go to the "branches".
Addresses gocritic complaints.
Related to #10466