From 82ded80fcef1965ab5357a89d201811436b5d8d7 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sun, 29 May 2022 11:49:57 -0400 Subject: Stop passing the config in the context Signed-off-by: Dave Henderson --- funcs.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'funcs.go') diff --git a/funcs.go b/funcs.go index 53c35568..d067e3cf 100644 --- a/funcs.go +++ b/funcs.go @@ -12,9 +12,7 @@ import ( // Funcs - // Deprecated: use CreateFuncs instead func Funcs(d *data.Data) template.FuncMap { - ctx := context.Background() - cfg := config.FromContext(ctx) - return CreateFuncs(config.ContextWithConfig(ctx, cfg), d) + return CreateFuncs(context.Background(), d) } // CreateFuncs - function mappings are created here @@ -49,3 +47,12 @@ func addToMap(dst, src map[string]interface{}) { dst[k] = v } } + +// SetExperimental enables experimental functions and features in the given +// context. This must be done before creating functions. The set of experimental +// features enabled by this is not fixed and will change over time. +func SetExperimental(ctx context.Context) context.Context { + // This just calls the internal function. This is here to make experimental + // functions available to external packages. + return config.SetExperimental(ctx) +} -- cgit v1.2.3