1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-08-15 20:02:56 +02:00

Use custom type for keying Context

See https://blog.golang.org/context#TOC_3.2
This commit is contained in:
David Landry
2018-10-05 17:26:30 -04:00
parent b970bf5a2b
commit 5f201de7f9

View File

@@ -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)