stackruntime: Our fake telemetry span must be passed by pointer

Most of our Span actions don't mutate the object because we just
immediately emit messages to the test log, but SetName directly modifies
the span name so we need to pass by pointer so we can honor that rename.
pull/34738/head
Martin Atkins 3 years ago
parent 03c981d9d0
commit 2b7fad5bee

@ -178,7 +178,7 @@ func (t *testLogTracer) Start(ctx context.Context, spanName string, opts ...trac
TraceID: fakeTraceIDForTesting,
SpanID: spanID,
})
span := testLogTraceSpan{
span := &testLogTraceSpan{
name: spanName,
context: &spanCtx,
t: t.t,
@ -210,7 +210,7 @@ type testLogTraceSpan struct {
embedded.Span
}
var _ trace.Span = testLogTraceSpan{}
var _ trace.Span = (*testLogTraceSpan)(nil)
func (s testLogTraceSpan) log(f string, args ...any) {
s.t.Helper()
@ -263,7 +263,7 @@ func (s testLogTraceSpan) SetAttributes(kv ...attribute.KeyValue) {
}
// SetName implements trace.Span.
func (s testLogTraceSpan) SetName(name string) {
func (s *testLogTraceSpan) SetName(name string) {
s.t.Helper()
s.log("RENAMED to %s", name)
s.name = name

Loading…
Cancel
Save