1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-17 20:57:51 +02:00

add explicit error handling for span data

This commit is contained in:
Stefan Prisca 2020-05-05 09:07:11 +02:00
parent 75b4d68499
commit e1c90dca8a

View File

@ -120,7 +120,13 @@ func (tc nameAttributeTestCase) testUCISetsExpectedNameAttribute(t *testing.T) {
t.Fatalf("failed to run unary interceptor: %v", err)
}
attributes := exp.spanMap[tc.fullName()][0].Attributes
spanData, hasSpanData := exp.spanMap[tc.fullName()]
if !hasSpanData || len(spanData) == 0 {
t.Fatalf("no span data found for name < %s >", tc.fullName())
}
attributes := spanData[0].Attributes
var actualServiceName string
for _, attr := range attributes {