Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFuncMap = template.FuncMap{ "base64": func(in string) string { return base64.StdEncoding.EncodeToString([]byte(in)) }, "prefixContinuationLinesWith": bytesutil.PrefixContinuationLinesWith, "lowerFirst": func(s string) string { return string(unicode.ToLower(rune(s[0]))) + s[1:] }, "pretty": func(data any) string { return pretty.Sprintf("%# v", data) }, "prettyLazy": func(data any) string { return pretty.LazySprintf("%# v", data) }, "quote": func(data any) string { return pretty.Sprintf("%q", data) }, }
DefaultFuncMap holds common template functions.
Functions ¶
func MergeFuncMaps ¶
MergeFuncMaps returns all functions of "a" and all functions of "b" in a new function mapping. For entries that are defined in both maps the entry defined in b is chosen.
func RewriteFileAsTemplate ¶
RewriteFileAsTemplate read in a file, execute it as a template with the given data and save the result into the same file.
Types ¶
Click to show internal directories.
Click to hide internal directories.