1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

TraceID and SpanID implementations for Stringer Interface (#642)

* TraceID and SpanID implementations for Stringer Interface

* Hex encode while stringifying

* Modify format specifiers wherever SpanID is used

* comment changes

* Remove TraceIdString() and SpanIdString()

* Comments Fixes
This commit is contained in:
Shouri Piratla
2020-04-17 04:12:48 +05:30
committed by GitHub
parent ebc245b388
commit 669d4b3a6c
6 changed files with 75 additions and 79 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ func BenchmarkTraceID_DotString(b *testing.B) {
want := "0000000000000001000000000000002a"
for i := 0; i < b.N; i++ {
if got := sc.TraceIDString(); got != want {
if got := sc.TraceID.String(); got != want {
b.Fatalf("got = %q want = %q", got, want)
}
}
@@ -149,7 +149,7 @@ func BenchmarkSpanID_DotString(b *testing.B) {
sc := core.SpanContext{SpanID: core.SpanID{1}}
want := "0100000000000000"
for i := 0; i < b.N; i++ {
if got := sc.SpanIDString(); got != want {
if got := sc.SpanID.String(); got != want {
b.Fatalf("got = %q want = %q", got, want)
}
}