Skip to content

Commit fb04e21

Browse files
committed
fix linting
Signed-off-by: Florian Bacher <[email protected]>
1 parent 549bdc3 commit fb04e21

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

pkg/ottl/ottlfuncs/func_scale.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import (
77
"context"
88
"errors"
99
"fmt"
10-
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
10+
1111
"go.opentelemetry.io/collector/pdata/pmetric"
12+
13+
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
1214
)
1315

1416
type ScaleArguments[K any] struct {

pkg/ottl/ottlfuncs/func_scale_test.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ package ottlfuncs
55

66
import (
77
"context"
8-
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
8+
"testing"
9+
910
"github.com/stretchr/testify/assert"
1011
"go.opentelemetry.io/collector/pdata/pcommon"
1112
"go.opentelemetry.io/collector/pdata/pmetric"
12-
"testing"
13+
14+
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
1315
)
1416

1517
func TestScale(t *testing.T) {
@@ -28,7 +30,7 @@ func TestScale(t *testing.T) {
2830
name: "scale float value",
2931
args: args{
3032
value: &ottl.StandardGetSetter[any]{
31-
Getter: func(ctx context.Context, tCtx any) (any, error) {
33+
Getter: func(_ context.Context, _ any) (any, error) {
3234
return 1.05, nil
3335
},
3436
},
@@ -43,7 +45,7 @@ func TestScale(t *testing.T) {
4345
name: "scale int value",
4446
args: args{
4547
value: &ottl.StandardGetSetter[any]{
46-
Getter: func(ctx context.Context, tCtx any) (any, error) {
48+
Getter: func(_ context.Context, _ any) (any, error) {
4749
return int64(1), nil
4850
},
4951
},
@@ -58,7 +60,7 @@ func TestScale(t *testing.T) {
5860
name: "unsupported data type",
5961
args: args{
6062
value: &ottl.StandardGetSetter[any]{
61-
Getter: func(ctx context.Context, tCtx any) (any, error) {
63+
Getter: func(_ context.Context, _ any) (any, error) {
6264
return "foo", nil
6365
},
6466
},
@@ -73,7 +75,7 @@ func TestScale(t *testing.T) {
7375
name: "scale gauge float metric",
7476
args: args{
7577
value: &ottl.StandardGetSetter[any]{
76-
Getter: func(ctx context.Context, tCtx any) (any, error) {
78+
Getter: func(_ context.Context, _ any) (any, error) {
7779
metric := pmetric.NewMetric()
7880
metric.SetName("test-metric")
7981
metric.SetEmptyGauge()
@@ -98,7 +100,7 @@ func TestScale(t *testing.T) {
98100
name: "scale gauge int metric",
99101
args: args{
100102
value: &ottl.StandardGetSetter[any]{
101-
Getter: func(ctx context.Context, tCtx any) (any, error) {
103+
Getter: func(_ context.Context, _ any) (any, error) {
102104
metric := pmetric.NewMetric()
103105
metric.SetName("test-metric")
104106
metric.SetEmptyGauge()
@@ -123,7 +125,7 @@ func TestScale(t *testing.T) {
123125
name: "scale sum metric",
124126
args: args{
125127
value: &ottl.StandardGetSetter[any]{
126-
Getter: func(ctx context.Context, tCtx any) (any, error) {
128+
Getter: func(_ context.Context, _ any) (any, error) {
127129
metric := pmetric.NewMetric()
128130
metric.SetName("test-metric")
129131
metric.SetEmptySum()
@@ -148,7 +150,7 @@ func TestScale(t *testing.T) {
148150
name: "scale histogram metric",
149151
args: args{
150152
value: &ottl.StandardGetSetter[any]{
151-
Getter: func(ctx context.Context, tCtx any) (any, error) {
153+
Getter: func(_ context.Context, _ any) (any, error) {
152154
metric := getTestHistogramMetric(1, 4, 1, 3, []float64{1, 10}, []uint64{1, 2}, []float64{1.0}, 1, 1)
153155
return metric.Histogram().DataPoints(), nil
154156

@@ -166,7 +168,7 @@ func TestScale(t *testing.T) {
166168
name: "scale SummaryDataPointValueAtQuantileSlice",
167169
args: args{
168170
value: &ottl.StandardGetSetter[any]{
169-
Getter: func(ctx context.Context, tCtx any) (any, error) {
171+
Getter: func(_ context.Context, _ any) (any, error) {
170172
metric := pmetric.NewSummaryDataPointValueAtQuantileSlice()
171173
metric.AppendEmpty().SetValue(1.0)
172174
return metric, nil
@@ -186,7 +188,7 @@ func TestScale(t *testing.T) {
186188
name: "scale ExemplarSlice",
187189
args: args{
188190
value: &ottl.StandardGetSetter[any]{
189-
Getter: func(ctx context.Context, tCtx any) (any, error) {
191+
Getter: func(_ context.Context, _ any) (any, error) {
190192
metric := pmetric.NewExemplarSlice()
191193
metric.AppendEmpty().SetDoubleValue(1.0)
192194
return metric, nil
@@ -205,7 +207,7 @@ func TestScale(t *testing.T) {
205207
name: "unsupported: exponential histogram metric",
206208
args: args{
207209
value: &ottl.StandardGetSetter[any]{
208-
Getter: func(ctx context.Context, tCtx any) (any, error) {
210+
Getter: func(_ context.Context, _ any) (any, error) {
209211
return pmetric.NewExponentialHistogramDataPointSlice(), nil
210212

211213
},

0 commit comments

Comments
 (0)