Skip to content

Commit

Permalink
[pkg/ottl] enable exhaustive lint (open-telemetry#26311)
Browse files Browse the repository at this point in the history
**Description:** 
related open-telemetry#23266

Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 authored Aug 30, 2023
1 parent 8c9bc1f commit b958da4
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit b958da4

Please sign in to comment.