Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove String and Size methods of TraceID and SpanID #1199

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions sdk/telemetry/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ const (
// TraceID is a custom data type that is used for all trace IDs.
type TraceID [traceIDSize]byte

// String returns the hex string representation form of a TraceID.
func (tid TraceID) String() string {
return hex.EncodeToString(tid[:])
}

// Size returns the size of the data to serialize.
func (tid TraceID) Size() int {
if tid.IsEmpty() {
return 0
}
return traceIDSize
}

// IsEmpty returns false if id contains at least one non-zero byte.
func (tid TraceID) IsEmpty() bool {
return tid == [traceIDSize]byte{}
Expand All @@ -53,19 +40,6 @@ func (tid *TraceID) UnmarshalJSON(data []byte) error {
// SpanID is a custom data type that is used for all span IDs.
type SpanID [spanIDSize]byte

// String returns the hex string representation form of a SpanID.
func (sid SpanID) String() string {
return hex.EncodeToString(sid[:])
}

// Size returns the size of the data to serialize.
func (sid SpanID) Size() int {
if sid.IsEmpty() {
return 0
}
return spanIDSize
}

// IsEmpty returns true if the span ID contains at least one non-zero byte.
func (sid SpanID) IsEmpty() bool {
return sid == [spanIDSize]byte{}
Expand Down
Loading