comment update for package gtrace

This commit is contained in:
John Guo 2021-09-22 19:12:31 +08:00
parent ad2b3e6cc6
commit b2629b9bfa
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ import (
// Carrier is the storage medium used by a TextMapPropagator.
type Carrier map[string]interface{}
// NewCarrier .
// NewCarrier creates and returns a Carrier.
func NewCarrier(data ...map[string]interface{}) Carrier {
if len(data) > 0 && data[0] != nil {
return data[0]
@ -50,12 +50,12 @@ func (c Carrier) MustMarshal() []byte {
return b
}
// String .
// String converts and returns current Carrier as string.
func (c Carrier) String() string {
return string(c.MustMarshal())
}
// UnmarshalJSON .
// UnmarshalJSON implements interface UnmarshalJSON for package json.
func (c Carrier) UnmarshalJSON(b []byte) error {
carrier := NewCarrier(nil)
return json.UnmarshalUseNumber(b, carrier)

View File

@ -12,7 +12,7 @@ import (
"go.opentelemetry.io/otel/trace"
)
// Span
// Span warps trace.Span for compatibility and extension.
type Span struct {
trace.Span
}

View File

@ -11,7 +11,7 @@ import (
"go.opentelemetry.io/otel/trace"
)
// Tracer .
// Tracer warps trace.Tracer for compatibility and extension.
type Tracer struct {
trace.Tracer
}