Commit 71932ccc authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

template/interpolate: export RenderInterface

parent 9d2e9268
...@@ -36,7 +36,7 @@ func RenderMap(v interface{}, ctx *Context, f *RenderFilter) (map[string]interfa ...@@ -36,7 +36,7 @@ func RenderMap(v interface{}, ctx *Context, f *RenderFilter) (map[string]interfa
continue continue
} }
raw, err := renderInterface(raw, ctx) raw, err := RenderInterface(raw, ctx)
if err != nil { if err != nil {
return nil, fmt.Errorf("render '%s': %s", k, err) return nil, fmt.Errorf("render '%s': %s", k, err)
} }
...@@ -47,7 +47,8 @@ func RenderMap(v interface{}, ctx *Context, f *RenderFilter) (map[string]interfa ...@@ -47,7 +47,8 @@ func RenderMap(v interface{}, ctx *Context, f *RenderFilter) (map[string]interfa
return m, nil return m, nil
} }
func renderInterface(v interface{}, ctx *Context) (interface{}, error) { // RenderInterface renders any value and returns the resulting value.
func RenderInterface(v interface{}, ctx *Context) (interface{}, error) {
f := func(v string) (string, error) { f := func(v string) (string, error) {
return Render(v, ctx) return Render(v, ctx)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment