func (jaeger Jaeger) Inject(ctx context.Context, carrier propagation.TextMapCarrier) {
	sc := trace.SpanFromContext(ctx).SpanContext()
	headers := []string{}
	if !sc.TraceID().IsValid() || !sc.SpanID().IsValid() {
		return
	}
	headers = append(headers, sc.TraceID().String(), sc.SpanID().String(), deprecatedParentSpanID)
	if debugFromContext(ctx) {
		headers = append(headers, fmt.Sprintf("%x", flagsDebug|flagsSampled))
	} else if sc.IsSampled() {
		headers = append(headers, fmt.Sprintf("%x", flagsSampled))
	} else {
		headers = append(headers, fmt.Sprintf("%x", flagsNotSampled))
	}
	carrier.Set(jaegerHeader, strings.Join(headers, separator))
}
Inject injects a context to the carrier following jaeger format.
The parent span ID is set to an dummy parent span id as the most implementations do.
package jaeger
import (
	"context"
	"errors"
	"fmt"
	"strconv"
	"strings"
	"go.opentelemetry.io/otel/propagation"
	"go.opentelemetry.io/otel/trace"
)
const (
	jaegerHeader        = "uber-trace-id"
	separator           = ":"
	traceID64bitsWidth  = 64 / 4
	traceID128bitsWidth = 128 / 4
	spanIDWidth         = 64 / 4
	traceIDPadding = "0000000000000000"
	flagsDebug      = 0x02
	flagsSampled    = 0x01
	flagsNotSampled = 0x00
	deprecatedParentSpanID = "0"
)
var (
	empty = trace.SpanContext{}
	errMalformedTraceContextVal = errors.New("header value of uber-trace-id should contain four different part separated by : ")
	errInvalidTraceIDLength     = errors.New("invalid trace id length, must be either 16 or 32")
	errMalformedTraceID         = errors.New("cannot decode trace id from header, should be a string of hex, lowercase trace id can't be all zero")
	errInvalidSpanIDLength      = errors.New("invalid span id length, must be 16")
	errMalformedSpanID          = errors.New("cannot decode span id from header, should be a string of hex, lowercase span id can't be all zero")
	errMalformedFlag            = errors.New("cannot decode flag")
)
type Jaeger struct{}
var _ propagation.TextMapPropagator = &Jaeger{}