From 70e67f614f82601fba46836b0864ee3c4f3ddcbe Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Sun, 20 Aug 2023 10:13:41 +0800 Subject: [PATCH] [internal/filter] enable exhaustive lint Signed-off-by: Ziqi Zhao --- internal/filter/filterexpr/matcher.go | 1 + internal/filter/filterottl/functions.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/filter/filterexpr/matcher.go b/internal/filter/filterexpr/matcher.go index 225846618f5d..f85f2c0dff68 100644 --- a/internal/filter/filterexpr/matcher.go +++ b/internal/filter/filterexpr/matcher.go @@ -51,6 +51,7 @@ func (m *Matcher) MatchMetric(metric pmetric.Metric) (bool, error) { metricName := metric.Name() vm := vmPool.Get().(*vm.VM) defer vmPool.Put(vm) + //exhaustive:enforce switch metric.Type() { case pmetric.MetricTypeGauge: return m.matchGauge(metricName, metric.Gauge(), vm) diff --git a/internal/filter/filterottl/functions.go b/internal/filter/filterottl/functions.go index be36b3999861..ef08af2527b3 100644 --- a/internal/filter/filterottl/functions.go +++ b/internal/filter/filterottl/functions.go @@ -120,6 +120,7 @@ func hasAttributeKeyOnDatapoint(key string) (ottl.ExprFunc[ottlmetric.TransformC func checkDataPoints(tCtx ottlmetric.TransformContext, key string, expectedVal *string) (interface{}, error) { metric := tCtx.GetMetric() + //exhaustive:enforce switch metric.Type() { case pmetric.MetricTypeSum: return checkNumberDataPointSlice(metric.Sum().DataPoints(), key, expectedVal), nil