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

[pkg/ottl] enable exhaustive lint #26311

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/ottl/contexts/internal/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func accessDataPoints[K MetricContext]() ottl.StandardGetSetter[K] {
return ottl.StandardGetSetter[K]{
Getter: func(ctx context.Context, tCtx K) (interface{}, error) {
metric := tCtx.GetMetric()
//exhaustive:enforce
switch metric.Type() {
case pmetric.MetricTypeSum:
return metric.Sum().DataPoints(), nil
Expand All @@ -193,6 +194,7 @@ func accessDataPoints[K MetricContext]() ottl.StandardGetSetter[K] {
},
Setter: func(ctx context.Context, tCtx K, val interface{}) error {
metric := tCtx.GetMetric()
//exhaustive:enforce
switch metric.Type() {
case pmetric.MetricTypeSum:
if newDataPoints, ok := val.(pmetric.NumberDataPointSlice); ok {
Expand Down
Loading