Documentation
¶
Index ¶
- Constants
- Variables
- func CopyAndRenderFile(tmplCtx *templating.TemplateContext, src, target string) error
- func GetFileCandidates(baseName string, extensions ...string) []string
- func RemoveTemplateExt(filename string) string
- func ResolveFirstExistingFile(root string, candidates ...string) (string, error)
Constants ¶
View Source
const TemplateExtensionGoTemplate = "gotpl"
TemplateExtensionGoTemplate is the file extension used for Go template files.
Variables ¶
View Source
var NoFileCandidatesErr = errors.New("no file candidates found")
NoFileCandidatesErr is returned when no matching file candidates exist on disk.
Functions ¶
func CopyAndRenderFile ¶
func CopyAndRenderFile(tmplCtx *templating.TemplateContext, src, target string) error
CopyAndRenderFile copies src to target, rendering it through a template processor if the file extension matches a supported templating engine.
func GetFileCandidates ¶
GetFileCandidates returns all possible file names for a base name, including templated variants for each supported template extension.
func RemoveTemplateExt ¶
RemoveTemplateExt strips a recognized template extension (e.g. ".gotpl") from the filename if present.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.