Skip to content

Commit 926ceb0

Browse files
committed
fix golangci-lint errors
Signed-off-by: Akhil Mohan <[email protected]>
1 parent 4030ae2 commit 926ceb0

5 files changed

Lines changed: 6 additions & 3 deletions

File tree

content/helpers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func TestCopy(t *testing.T) {
143143
}
144144

145145
for _, testcase := range testcases {
146+
testcase := testcase
146147
t.Run(testcase.name, func(t *testing.T) {
147148
err := Copy(context.Background(),
148149
&testcase.writer,

metadata/containers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) {
619619
},
620620
},
621621
} {
622+
testcase := testcase
622623
t.Run(testcase.name, func(t *testing.T) {
623624
testcase.original.ID = testcase.name
624625
if testcase.input.ID == "" {

metadata/images_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) {
479479
cause: errdefs.ErrNotFound,
480480
},
481481
} {
482+
testcase := testcase
482483
t.Run(testcase.name, func(t *testing.T) {
483484
testcase.original.Name = testcase.name
484485
if testcase.input.Name == "" {

tracing/plugin/otlp.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,9 @@ func newExporter(ctx context.Context, cfg *OTLPConfig) (*otlptrace.Exporter, err
141141
opts = append(opts, otlptracegrpc.WithInsecure())
142142
}
143143
return otlptracegrpc.New(ctx, opts...)
144-
} else {
145-
// Other protocols such as "http/json" are not supported.
146-
return nil, fmt.Errorf("OpenTelemetry protocol %q : %w", cfg.Protocol, errdefs.ErrNotImplemented)
147144
}
145+
// Other protocols such as "http/json" are not supported.
146+
return nil, fmt.Errorf("OpenTelemetry protocol %q : %w", cfg.Protocol, errdefs.ErrNotImplemented)
148147
}
149148

150149
// newTracer configures protocol-agonostic tracing settings such as

tracing/plugin/otlp_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func TestNewExporter(t *testing.T) {
7070
output: errdefs.ErrNotImplemented,
7171
},
7272
} {
73+
testcase := testcase
7374
t.Run(testcase.name, func(t *testing.T) {
7475
t.Logf("input: %v", testcase.input)
7576

0 commit comments

Comments
 (0)