From 5f201de7f93875ea624c682a5cc6ba1ff7bb8784 Mon Sep 17 00:00:00 2001 From: David Landry Date: Fri, 5 Oct 2018 17:26:30 -0400 Subject: [PATCH] Use custom type for keying Context See https://blog.golang.org/context#TOC_3.2 --- pkg/runtime/core/param.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/runtime/core/param.go b/pkg/runtime/core/param.go index 41bb3642..ff93f371 100644 --- a/pkg/runtime/core/param.go +++ b/pkg/runtime/core/param.go @@ -2,7 +2,8 @@ package core import "context" -const paramsKey = "params" +type key int +const paramsKey key = 0 func ParamsWith(ctx context.Context, params map[string]Value) context.Context { return context.WithValue(ctx, paramsKey, params)