Skip to content

Commit

Permalink
fix golangci-lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
  • Loading branch information
Akhil Mohan committed Mar 1, 2024
1 parent 4030ae2 commit 926ceb0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions content/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func TestCopy(t *testing.T) {
}

for _, testcase := range testcases {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
err := Copy(context.Background(),
&testcase.writer,
Expand Down
1 change: 1 addition & 0 deletions metadata/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) {
},
},
} {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
testcase.original.ID = testcase.name
if testcase.input.ID == "" {
Expand Down
1 change: 1 addition & 0 deletions metadata/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) {
cause: errdefs.ErrNotFound,
},
} {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
testcase.original.Name = testcase.name
if testcase.input.Name == "" {
Expand Down
5 changes: 2 additions & 3 deletions tracing/plugin/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,9 @@ func newExporter(ctx context.Context, cfg *OTLPConfig) (*otlptrace.Exporter, err
opts = append(opts, otlptracegrpc.WithInsecure())
}
return otlptracegrpc.New(ctx, opts...)
} else {
// Other protocols such as "http/json" are not supported.
return nil, fmt.Errorf("OpenTelemetry protocol %q : %w", cfg.Protocol, errdefs.ErrNotImplemented)
}
// Other protocols such as "http/json" are not supported.
return nil, fmt.Errorf("OpenTelemetry protocol %q : %w", cfg.Protocol, errdefs.ErrNotImplemented)
}

// newTracer configures protocol-agonostic tracing settings such as
Expand Down
1 change: 1 addition & 0 deletions tracing/plugin/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestNewExporter(t *testing.T) {
output: errdefs.ErrNotImplemented,
},
} {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
t.Logf("input: %v", testcase.input)

Expand Down

0 comments on commit 926ceb0

Please sign in to comment.