// TraceID returns the trace ID loaded in the *http.Request.
TraceID returns the trace ID loaded in the *http.Request.
// TraceID returns the trace ID loaded in the * http . Request .
func TraceID(r *http.Request) (string, error) {
	ctx := r.Context()
	if nil == ctx {
		return "", errNilContext
	}
	traceIDInterface := ctx.Value(traceIDContextKey)
	if nil == traceIDInterface {
		return "", errNilTraceID
	}
	traceID, ok := traceIDInterface.(string)
	if !ok {
		return "", errBadTraceID
	}
	return traceID, nil
}
func TraceID ( r * http . Request ) ( string , error ) { ctx := r . Context ( ) if nil == ctx { return " " , errNilContext } traceIDInterface := ctx . Value ( traceIDContextKey ) if nil == traceIDInterface { return " " , errNilTraceID } traceID , ok := traceIDInterface . ( string ) if ! ok { return " " , errBadTraceID } return traceID , nil }
TraceID returns the trace ID loaded in the *http.Request.
TraceID returns the trace ID loaded in the * http . Request .