Skip to content

Commit

Permalink
Remove String and Size methods of TraceID and SpanID (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored Oct 18, 2024
1 parent c05bbc7 commit 8b55ec1
Showing 1 changed file with 0 additions and 26 deletions.
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

0 comments on commit 8b55ec1

Please sign in to comment.