Skip to content

Commit 80b8882

Browse files
committed
Use alias vs 2 structs
1 parent 63b177e commit 80b8882

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

coderd/tracing/httpmw_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"testing"
1010

1111
"go.opentelemetry.io/otel/trace"
12+
"go.opentelemetry.io/otel/trace/noop"
1213

1314
"github.com/go-chi/chi/v5"
1415
"github.com/stretchr/testify/require"
@@ -17,7 +18,13 @@ import (
1718
"github.com/coder/coder/v2/testutil"
1819
)
1920

21+
// noopTracer is just an alias because the fakeTracer implements a method
22+
// with the same name 'Tracer'. Kinda dumb, but this is a workaround.
23+
type noopTracer = noop.Tracer
24+
2025
type fakeTracer struct {
26+
noop.TracerProvider
27+
noopTracer
2128
startCalled int64
2229
}
2330

0 commit comments

Comments
 (0)