yaml render func
This commit is contained in:
parent
482d3c83ba
commit
50bb60823f
@ -135,6 +135,11 @@ func (t *Template) Execute(contextName, elementName string, wr io.Writer, data i
|
|||||||
indented = indent + strings.Replace(s, "\n", "\n"+indent, -1)
|
indented = indent + strings.Replace(s, "\n", "\n"+indent, -1)
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
|
"yaml": func(v any) (s string, err error) {
|
||||||
|
ba, err := yaml.Marshal(v)
|
||||||
|
s = string(ba)
|
||||||
|
return
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, f := range extraFuncs {
|
for name, f := range extraFuncs {
|
||||||
|
Loading…
Reference in New Issue
Block a user