summaryrefslogtreecommitdiff
path: root/funcs.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2022-05-29 11:49:57 -0400
committerDave Henderson <dhenderson@gmail.com>2022-05-29 11:52:46 -0400
commit82ded80fcef1965ab5357a89d201811436b5d8d7 (patch)
tree14914504ad80adb66cdd31c196db42c5a34b46b5 /funcs.go
parent170593638bb7cf10f5ec8309112d775059f40e02 (diff)
Stop passing the config in the context
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'funcs.go')
-rw-r--r--funcs.go13
1 files changed, 10 insertions, 3 deletions
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)
+}