mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-13 19:52:52 +02:00
Use custom type for keying Context
See https://blog.golang.org/context#TOC_3.2
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user