From 118aeab02c94b5bbddc6358f170c1ac05e85cfc8 Mon Sep 17 00:00:00 2001 From: Annanay Agarwal Date: Wed, 5 Aug 2020 14:21:36 +0530 Subject: [PATCH] Make context key type public (#7748) Signed-off-by: Annanay --- promql/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/promql/engine.go b/promql/engine.go index 007422c64..935872ef1 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -137,7 +137,7 @@ type query struct { ng *Engine } -type queryOrigin struct{} +type QueryOrigin struct{} // Statement implements the Query interface. func (q *query) Statement() parser.Statement { @@ -414,7 +414,7 @@ func (ng *Engine) exec(ctx context.Context, q *query) (v parser.Value, ws storag f = append(f, "spanID", spanCtx.SpanID()) } } - if origin := ctx.Value(queryOrigin{}); origin != nil { + if origin := ctx.Value(QueryOrigin{}); origin != nil { for k, v := range origin.(map[string]interface{}) { f = append(f, k, v) } @@ -2116,7 +2116,7 @@ func shouldDropMetricName(op parser.ItemType) bool { // NewOriginContext returns a new context with data about the origin attached. func NewOriginContext(ctx context.Context, data map[string]interface{}) context.Context { - return context.WithValue(ctx, queryOrigin{}, data) + return context.WithValue(ctx, QueryOrigin{}, data) } func formatDate(t time.Time) string {