Skip to content

Commit

Permalink
Add wrapcheck (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Jun 6, 2024
1 parent b5af296 commit 9dcc90e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ linters:
- noctx
- nolintlint
- paralleltest
- perfsprint
- prealloc
- predeclared
- reassign
Expand All @@ -91,7 +92,8 @@ linters:
- unused
- usestdlibvars
- wastedassign
- perfsprint
- whitespace
- wrapcheck
disable-all: true
issues:
max-issues-per-linter: 0
Expand Down
7 changes: 6 additions & 1 deletion pkg/telemetry/span_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package telemetry

import (
"context"
"fmt"

"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
Expand All @@ -23,5 +24,9 @@ func CreateOTLPSpanProvider(options ...otlptracegrpc.Option) SpanProvider {
// newOTLPExporter creates a new gRPC OTLP exporter.
func newOTLPExporter(ctx context.Context, options ...otlptracegrpc.Option) (*otlptrace.Exporter, error) {
traceClient := otlptracegrpc.NewClient(options...)
return otlptrace.New(ctx, traceClient)
exp, err := otlptrace.New(ctx, traceClient)
if err != nil {
return nil, fmt.Errorf("failed to create OTLP exporter: %w", err)
}
return exp, nil
}

0 comments on commit 9dcc90e

Please sign in to comment.